From 9a23a8d68cfa3477b55778818d7d06b468f9b5ca Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Mon, 29 Aug 2022 01:00:10 +0200 Subject: Get game install location on application load --- src-ui/src/main.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src-ui/src') diff --git a/src-ui/src/main.ts b/src-ui/src/main.ts index e769a1b5..e5149bdd 100644 --- a/src-ui/src/main.ts +++ b/src-ui/src/main.ts @@ -13,13 +13,6 @@ document.addEventListener("DOMContentLoaded", async function () { let installLocationHolderEl = $("install-location-holder") as HTMLElement; let versionNumberHolderEl = $("version-number-holder") as HTMLElement; - // listen backend-ping event (from Tauri Rust App) - listen("install-location-result", function (evt: TauriEvent) { - // alert(evt.payload); - // result = evt as String; - installLocationHolderEl.textContent = evt.payload; - }) - // listen backend-ping event (from Tauri Rust App) listen("backend-ping", function (evt: TauriEvent) { pingEl.classList.add("on"); @@ -50,6 +43,11 @@ document.addEventListener("DOMContentLoaded", async function () { }); // Run the following on initial page load + // Get version number let version_number_string = await invoke("get_version_number") as string; versionNumberHolderEl.textContent = version_number_string; + + // Get install location + let install_location = await invoke("find_game_install_location") as string; + installLocationHolderEl.textContent = install_location; }) -- cgit v1.2.3