From 9592ca243489fcc74fb82f4298769ea5b62c2cd8 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Sun, 2 Oct 2022 01:04:04 +0200 Subject: feat: Add update functionality Simply does the same thing as install as it just overwrites old files anyway --- src-vue/src/plugins/store.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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({ -- cgit v1.2.3