diff --git a/app/src/components/extensionLoader/hooks.js b/app/src/components/extensionLoader/hooks.js index b67ddad764..f6d86dad7c 100644 --- a/app/src/components/extensionLoader/hooks.js +++ b/app/src/components/extensionLoader/hooks.js @@ -28,6 +28,7 @@ const useDynamicScript = (scope, url) => { element.onerror = () => { setReady(false); setFailed(true); + element.remove(); }; document.head.appendChild(element); diff --git a/app/src/pages/common/uiExtensionPage/uiExtensionPage.jsx b/app/src/pages/common/uiExtensionPage/uiExtensionPage.jsx index 3475298c5d..242aa559df 100644 --- a/app/src/pages/common/uiExtensionPage/uiExtensionPage.jsx +++ b/app/src/pages/common/uiExtensionPage/uiExtensionPage.jsx @@ -32,26 +32,33 @@ export const UiExtensionPage = ({ extensions, activePluginPage }) => { const [headerNodes, setHeaderNodes] = useState({}); - const pageLayout = - extension && extension.newLayout ? ( - <> -
-
- {headerNodes.children} -
-
- - - - - ) : ( - - {extension && } - - - - - ); + let pageLayout = null; + + if (extension) { + if (extension.newLayout) { + pageLayout = ( + <> +
+
+ {headerNodes.children} +
+
+ + + + + ); + } else { + pageLayout = ( + + + + + + + ); + } + } return pageLayout; };