aboutsummaryrefslogtreecommitdiff
path: root/src-ui/src
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2022-08-29 16:56:18 +0200
committerGeckoEidechse <gecko.eidechse+git@pm.me>2022-08-29 16:56:18 +0200
commitf231067aac2b165e049c1c974c1e25811ea30e1d (patch)
tree9163b895d2476fab9acebae33283072781adcdbe /src-ui/src
parentfdea87cf67e1f55343417feb3aa32c87e7ff1ba6 (diff)
downloadFlightCore-f231067aac2b165e049c1c974c1e25811ea30e1d.tar.gz
FlightCore-f231067aac2b165e049c1c974c1e25811ea30e1d.zip
Add variable to track global state
Diffstat (limited to 'src-ui/src')
-rw-r--r--src-ui/src/main.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src-ui/src/main.ts b/src-ui/src/main.ts
index f9677938..c6a19170 100644
--- a/src-ui/src/main.ts
+++ b/src-ui/src/main.ts
@@ -3,6 +3,13 @@ import { listen, Event as TauriEvent } from "@tauri-apps/api/event";
const $ = document.querySelector.bind(document);
+// Stores the overall state of the application
+var globalState = {
+ gamepath: "",
+ installed_northstar_version: "",
+ current_view: "" // Note sure if this is the right way to do it
+}
+
document.addEventListener("DOMContentLoaded", async function () {
// get the elements
const helloEl = $("div.hello")! as HTMLElement;
@@ -54,6 +61,7 @@ document.addEventListener("DOMContentLoaded", async function () {
if (install_location && install_location.length > 0) {
omniButtonEl.textContent = "Install";
installLocationHolderEl.textContent = install_location;
+ globalState.gamepath = install_location;
}
else {
omniButtonEl.textContent = "Find Titanfall2 install location";