mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-11 18:23:54 +01:00
35 lines
766 B
TypeScript
35 lines
766 B
TypeScript
import React from "react";
|
|
import ReactDOM from "react-dom";
|
|
|
|
import { TTheme as Theme, ThemeEvents, refreshTheme } from "./ui/React/Theme";
|
|
import { LoadingScreen } from "./ui/LoadingScreen";
|
|
import { initElectron } from "./Electron";
|
|
initElectron();
|
|
ReactDOM.render(
|
|
<Theme>
|
|
<LoadingScreen />
|
|
</Theme>,
|
|
document.getElementById("root"),
|
|
);
|
|
|
|
function rerender(): void {
|
|
refreshTheme();
|
|
ReactDOM.render(
|
|
<Theme>
|
|
<LoadingScreen />
|
|
</Theme>,
|
|
document.getElementById("root"),
|
|
);
|
|
}
|
|
|
|
(function () {
|
|
ThemeEvents.subscribe(rerender);
|
|
})();
|
|
|
|
(function () {
|
|
if (process.env.NODE_ENV === "development" || location.href.startsWith("file://")) return;
|
|
window.onbeforeunload = function () {
|
|
return "Your work will be lost.";
|
|
};
|
|
})();
|