diff options
author | Rémy Raes <contact@remyraes.com> | 2022-10-04 16:23:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-04 16:23:01 +0200 |
commit | 86c42dcdd4dc98405be8bc60e2063d0795653cf2 (patch) | |
tree | b846d856626c42f96cb728f2e09cbd327b43021e | |
parent | a05650191eff7d3a02239acef02941f3780e8404 (diff) | |
parent | dddbc93c3bab88a9d4ad3752cdfe35e15692e03f (diff) | |
download | FlightCore-86c42dcdd4dc98405be8bc60e2063d0795653cf2.tar.gz FlightCore-86c42dcdd4dc98405be8bc60e2063d0795653cf2.zip |
Merge pull request #11 from GeckoEidechse/feat/flightcore-oudated-notification
Show notification if FlightCore is outdated
-rw-r--r-- | src-vue/src/plugins/store.ts | 53 |
1 files changed, 12 insertions, 41 deletions
diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts index e392ea27..ccc90b1b 100644 --- a/src-vue/src/plugins/store.ts +++ b/src-vue/src/plugins/store.ts @@ -149,50 +149,21 @@ async function _initializeApp(state: any) { } async function _checkForFlightCoreUpdates(state: FlightCoreStore) { - // Get version number - let version_number_string = await invoke("get_version_number") as string; - // Check if up-to-date + // Check if FlightCore up-to-date let flightcore_is_outdated = await invoke("check_is_flightcore_outdated_caller") as boolean; - // Get host OS - let host_os_string = await invoke("get_host_os_caller") as string; - - // Get install location - await invoke("find_game_install_location_caller", { gamePath: state.game_path }) - .then((game_install) => { - // Found some gamepath - let game_install_obj = game_install as GameInstall; - - // Change installation state based on whether game install was found - state.northstar_state = NorthstarState.INSTALL; - state.game_path = game_install_obj.game_path; - state.install_type = game_install_obj.install_type as InstallType; - - // Check installed Northstar version if found - _get_northstar_version_number(state); - }) - .catch((error) => { - // Gamepath not found or other error - ElNotification({ - title: "Couldn't find game path", - message: error, - type: 'warning', - position: 'bottom-right' - }); - state.northstar_state = NorthstarState.GAME_NOT_FOUND; - }); - // --- This should be moved and is only placed here temporarily ----- - let game_install = { - game_path: state.game_path, - install_type: state.install_type.toString() - } as GameInstall; - await invoke("get_log_list_caller", { gameInstall: game_install }) - .then((message) => { - console.log(message); - }) - .catch((error) => { - console.error(error); + // Get FlightCore version number + let flightcore_version_number = await invoke("get_version_number") as string; + + if (flightcore_is_outdated) { + ElNotification({ + title: 'FlightCore outdated!', + message: `Please update FlightCore. Running outdated version ${flightcore_version_number}`, + type: 'warning', + position: 'bottom-right', + duration: 0 // Duration `0` means the notification will not auto-vanish }); + } } /** |