aboutsummaryrefslogtreecommitdiff
path: root/src-ui/src
diff options
context:
space:
mode:
authorGeckoEidechse <gecko.eidechse+git@pm.me>2022-09-10 15:18:27 +0200
committerGeckoEidechse <gecko.eidechse+git@pm.me>2022-09-10 15:18:27 +0200
commit4462a2f53d5153d97691af72ed7a52f401ab6ef7 (patch)
treeca6de62ecef52aff4bfa79597a64316751d78555 /src-ui/src
parentacecd7f7ee551de0983378c09c540ac3ef2396fe (diff)
downloadFlightCore-4462a2f53d5153d97691af72ed7a52f401ab6ef7.tar.gz
FlightCore-4462a2f53d5153d97691af72ed7a52f401ab6ef7.zip
Return error result type if NS install fails
Diffstat (limited to 'src-ui/src')
-rw-r--r--src-ui/src/main.ts16
1 files changed, 13 insertions, 3 deletions
diff --git a/src-ui/src/main.ts b/src-ui/src/main.ts
index 39ddf2dd..3b2d2f7d 100644
--- a/src-ui/src/main.ts
+++ b/src-ui/src/main.ts
@@ -94,9 +94,19 @@ document.addEventListener("DOMContentLoaded", async function () {
break;
// Install Northstar
case button_install_string:
- omniButtonEl.textContent = "Installing";
- await invoke("install_northstar_caller", { gamePath: globalState.gamepath }) as boolean;
- alert("Done?");
+ let install_northstar_result = invoke("install_northstar_caller", { gamePath: globalState.gamepath });
+
+ // Update button while installl process is run
+ omniButtonEl.textContent = "Installing...";
+
+ await install_northstar_result.then((message) => {
+ console.log(message);
+ alert("Done installing Northstar");
+ })
+ .catch((error) => {
+ console.error(error);
+ alert(error);
+ });
get_northstar_version_number_and_set_button_accordingly(omniButtonEl);
break;