From 209f3372f7ff023a842a8d186130032397e5ad87 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Sat, 10 Sep 2022 16:49:59 +0200 Subject: Return error result type if NS update check fails --- src-ui/src/main.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src-ui/src') diff --git a/src-ui/src/main.ts b/src-ui/src/main.ts index 3b2d2f7d..e733cf4d 100644 --- a/src-ui/src/main.ts +++ b/src-ui/src/main.ts @@ -21,10 +21,17 @@ async function get_northstar_version_number_and_set_button_accordingly(omniButto if (northstar_version_number && northstar_version_number.length > 0) { globalState.installed_northstar_version = northstar_version_number; omniButtonEl.textContent = `${button_play_string} (${northstar_version_number})`; - let northstar_is_outdated = await invoke("check_is_northstar_outdated", { gamePath: globalState.gamepath }) as boolean; - if (northstar_is_outdated) { - omniButtonEl.textContent = button_update_string; - } + await invoke("check_is_northstar_outdated", { gamePath: globalState.gamepath }) + .then((message) => { + console.log(message); + if (message) { + omniButtonEl.textContent = button_update_string; + } + }) + .catch((error) => { + console.error(error); + alert(error); + }); } } -- cgit v1.2.3