diff options
author | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-08-26 11:59:22 +0200 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-08-26 11:59:22 +0200 |
commit | c28e67f262180c84fecbbee7dcbaaa217c836ba3 (patch) | |
tree | 4bf68f223429d21693f14a992467eb2776192b41 /src-ui/src/main.ts | |
parent | f73a31c82e152e28e84fb698edfd763105e933b5 (diff) | |
download | FlightCore-c28e67f262180c84fecbbee7dcbaaa217c836ba3.tar.gz FlightCore-c28e67f262180c84fecbbee7dcbaaa217c836ba3.zip |
Add a force crash button
Diffstat (limited to 'src-ui/src/main.ts')
-rw-r--r-- | src-ui/src/main.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src-ui/src/main.ts b/src-ui/src/main.ts index f964a6d5..f5f3f303 100644 --- a/src-ui/src/main.ts +++ b/src-ui/src/main.ts @@ -9,6 +9,7 @@ document.addEventListener("DOMContentLoaded", async function () { let counterButtonEl = $("counter-button") as HTMLElement; let counterResultEl = $("counter-result") as HTMLElement; let pingEl = $("backend-ping")! as HTMLElement; + let panicButtonEl = $("panic-button") as HTMLElement; // listen backend-ping event (from Tauri Rust App) listen("backend-ping", function (evt: TauriEvent<any>) { @@ -32,4 +33,10 @@ document.addEventListener("DOMContentLoaded", async function () { helloEl.textContent = "Click again"; }, 1000); }) -})
\ No newline at end of file + + // panic button click + panicButtonEl.addEventListener("pointerup", async function () { + await invoke("force_panic"); + alert("Never should have been able to get here!"); + }); +}) |