Add runtime environment detection
This commit is contained in:
@@ -3,6 +3,7 @@ import App from "./App"
|
||||
import { ThemeProvider } from "./lib/theme"
|
||||
import { ConfigProvider } from "./stores/preferences"
|
||||
import { InstanceConfigProvider } from "./stores/instance-config"
|
||||
import { runtimeEnv } from "./lib/runtime-env"
|
||||
import "./index.css"
|
||||
import "@git-diff-view/solid/styles/diff-view-pure.css"
|
||||
|
||||
@@ -12,6 +13,11 @@ if (!root) {
|
||||
throw new Error("Root element not found")
|
||||
}
|
||||
|
||||
if (typeof document !== "undefined") {
|
||||
document.documentElement.dataset.runtimeHost = runtimeEnv.host
|
||||
document.documentElement.dataset.runtimePlatform = runtimeEnv.platform
|
||||
}
|
||||
|
||||
render(
|
||||
() => (
|
||||
<ConfigProvider>
|
||||
|
||||
Reference in New Issue
Block a user