aboutsummaryrefslogtreecommitdiff
path: root/src-ui
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2022-09-20 15:35:49 +0200
committerGeckoEidechse <gecko.eidechse+git@pm.me>2022-09-20 15:35:49 +0200
commit3abf70c34f5a354afd89b10017ffda05aad4e54f (patch)
tree71da71c7aece0d8efb80747b1257d39e48f83b88 /src-ui
parent120d6834eeeabd77cab490bfd2e6afcf889b233f (diff)
downloadFlightCore-3abf70c34f5a354afd89b10017ffda05aad4e54f.tar.gz
FlightCore-3abf70c34f5a354afd89b10017ffda05aad4e54f.zip
Periodically check if Northstar is running
Diffstat (limited to 'src-ui')
-rw-r--r--src-ui/src/main.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/src-ui/src/main.ts b/src-ui/src/main.ts
index df88af15..f7aa6ec6 100644
--- a/src-ui/src/main.ts
+++ b/src-ui/src/main.ts
@@ -131,6 +131,22 @@ document.addEventListener("DOMContentLoaded", async function () {
console.log(evt.payload);
});
+ // listen northstar-running-ping event (from Tauri Rust App)
+ listen("northstar-running-ping", function (evt: TauriEvent<any>) {
+ let northstar_is_running = evt.payload as boolean;
+ if (northstar_is_running) {
+ omniButtonEl.textContent = button_launched_string;
+ }
+ else {
+ // Only set button to launch Northstar if was running before
+ // Otherwise we'd have to check on each access if Titanfall2 path set, Northstar is installed, etc.
+ if (omniButtonEl.textContent == button_launched_string) {
+ omniButtonEl.textContent = button_play_string;
+ }
+ }
+ console.log(evt.payload);
+ });
+
// omni button click
omniButtonEl.addEventListener("click", async function () {