aboutsummaryrefslogtreecommitdiff
path: root/src-ui/src
diff options
context:
space:
mode:
Diffstat (limited to 'src-ui/src')
-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 () {