From f231067aac2b165e049c1c974c1e25811ea30e1d Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Mon, 29 Aug 2022 16:56:18 +0200 Subject: Add variable to track global state --- src-ui/src/main.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src-ui') 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"; -- cgit v1.2.3