diff options
author | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-10-02 01:04:04 +0200 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-10-02 01:04:04 +0200 |
commit | 9592ca243489fcc74fb82f4298769ea5b62c2cd8 (patch) | |
tree | fda1d918d7402a01aea50c898a95cc16b9d612f1 /src-vue/src/plugins/store.ts | |
parent | e59529af2dfe8d51a10412dbc108f77c1af87053 (diff) | |
download | FlightCore-9592ca243489fcc74fb82f4298769ea5b62c2cd8.tar.gz FlightCore-9592ca243489fcc74fb82f4298769ea5b62c2cd8.zip |
feat: Add update functionality
Simply does the same thing as install as it just overwrites old files
anyway
Diffstat (limited to 'src-vue/src/plugins/store.ts')
-rw-r--r-- | src-vue/src/plugins/store.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts index 1ee3bfff..7fdc7814 100644 --- a/src-vue/src/plugins/store.ts +++ b/src-vue/src/plugins/store.ts @@ -59,6 +59,24 @@ export const store = createStore({ return; } + // Update northstar if it is outdated. + if (state.northstar_state === NorthstarState.MUST_UPDATE) { + // Updating is the same as installing, simply overwrites the existing files + let install_northstar_result = invoke("install_northstar_caller", { gamePath: state.game_path, northstarPackageName: ReleaseCanal.RELEASE }); + state.northstar_state = NorthstarState.UPDATING; + + await install_northstar_result.then((message) => { + console.log(message); + }) + .catch((error) => { + console.error(error); + alert(error); + }); + + _get_northstar_version_number(state); + return; + } + // Show an error message if Origin is not running. if (!state.origin_is_running) { ElNotification({ |