Revert dynamic adding #app DIV

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2023-03-01 13:34:47 -05:00
1 parent 5591c59f26
commit 0a9e858ab6
3 files changed
+3 -14

No files matched your search

@@ -15,7 +15,7 @@ const setupRootMacClassnameInjectable = getInjectable({
const isMac = di.inject(isMacInjectable);
const rootElem = di.inject(rootElementInjectable);
rootElem.classList.toggle("is-mac", isMac);
rootElem?.classList.toggle("is-mac", isMac);
},
}),
injectionToken: beforeFrameStartsSecondInjectionToken,
+1
View File
@@ -6,6 +6,7 @@
</head>
<body>
<div id="app"></div>
<div id="terminal-init"></div>
</body>
@@ -3,22 +3,10 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import isMacInjectable from "../../common/vars/is-mac.injectable";
const rootElementInjectable = getInjectable({
id: "root-element",
instantiate: (di) => {
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;
},
instantiate: () => document.getElementById("app"),
});
export default rootElementInjectable;