0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Fixed loading of react editor in production

no issue

- replaced use of `GhostAdmin` global when it doesn't exist in production by using the `Ember` global and picking the correct namespace
This commit is contained in:
Kevin Ansfield 2022-07-28 13:37:20 +01:00
parent fd0398d5e2
commit bd194f4ccc

View file

@ -1,4 +1,3 @@
/* global GhostAdmin */
import React, {Suspense} from 'react';
class ErrorHandler extends React.Component {
@ -33,6 +32,7 @@ const fetchKoenig = function () {
// the removal of `https://` and it's manual addition to the import template string is
// required to work around ember-auto-import complaining about an unknown dynamic import
// during the build step
const GhostAdmin = window.Ember.Namespace.NAMESPACES.find(ns => ns.name === 'ghost-admin');
const url = GhostAdmin.__container__.lookup('service:config').get('editor.url').replace('https://', '');
await import(`https://${url}`);