1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Revert dynamic adding #app DIV

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2023-02-24 15:41:17 -05:00
parent 5591c59f26
commit 0a9e858ab6
3 changed files with 3 additions and 14 deletions

View File

@ -15,7 +15,7 @@ const setupRootMacClassnameInjectable = getInjectable({
const isMac = di.inject(isMacInjectable); const isMac = di.inject(isMacInjectable);
const rootElem = di.inject(rootElementInjectable); const rootElem = di.inject(rootElementInjectable);
rootElem.classList.toggle("is-mac", isMac); rootElem?.classList.toggle("is-mac", isMac);
}, },
}), }),
injectionToken: beforeFrameStartsSecondInjectionToken, injectionToken: beforeFrameStartsSecondInjectionToken,

View File

@ -6,6 +6,7 @@
</head> </head>
<body> <body>
<div id="app"></div>
<div id="terminal-init"></div> <div id="terminal-init"></div>
</body> </body>

View File

@ -3,22 +3,10 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import isMacInjectable from "../../common/vars/is-mac.injectable";
const rootElementInjectable = getInjectable({ const rootElementInjectable = getInjectable({
id: "root-element", id: "root-element",
instantiate: (di) => { instantiate: () => document.getElementById("app"),
const isMac = di.inject(isMacInjectable);
const rootElement = document.createElement("div");
rootElement.id = "app";
rootElement.classList.toggle("is-mac", isMac);
document.getElementsByTagName("body")[0].append(rootElement);
return rootElement;
},
}); });
export default rootElementInjectable; export default rootElementInjectable;