Skip to content

Commit

Permalink
feat: Restore rest of repairwindow logic
Browse files Browse the repository at this point in the history
  • Loading branch information
GeckoEidechse committed Mar 2, 2025
1 parent d423124 commit 45cb475
Showing 1 changed file with 42 additions and 4 deletions.
46 changes: 42 additions & 4 deletions src-vue/src/views/RepairView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
{{ $t('settings.repair.window.disable_all_but_core') }}
</el-button>

<el-button type="primary" @click="forceInstallNorthstar">
{{ $t('settings.repair.window.force_reinstall_ns') }}
</el-button>

<el-button type="primary" @click="killNorthstar">
{{ $t('settings.repair.window.kill_northstar_process') }}
</el-button>
Expand All @@ -36,13 +40,12 @@

<script lang="ts">
import { defineComponent } from "vue";
import { InstallProgress } from "../../../src-tauri/bindings/InstallProgress";
import { invoke } from "@tauri-apps/api/core";
import { ReleaseCanal } from "../utils/ReleaseCanal";
import { load } from '@tauri-apps/plugin-store';
import { showErrorNotification, showNotification } from "../utils/ui";
import { getCurrentWindow } from "@tauri-apps/api/window";
const persistentStore = await load('flight-core-settings.json', { autoSave: false });
export default defineComponent({
Expand All @@ -62,6 +65,41 @@ export default defineComponent({
showErrorNotification(error);
});
},
async forceInstallNorthstar() {
// Send notification telling the user to wait for the process to finish
const notification = showNotification(
this.$t('settings.repair.window.reinstall_title'),
this.$t('settings.repair.window.reinstall_text'),
'info',
0
);
let install_northstar_result = invoke("install_northstar_wrapper", { gameInstall: this.$store.state.game_install, northstarPackageName: ReleaseCanal.RELEASE });
getCurrentWindow().listen<InstallProgress>(
'northstar-install-download-progress',
({ payload }) => {
let typed_payload = payload;
console.log("current_downloaded:", typed_payload.current_downloaded);
console.log("total_size: ", typed_payload.total_size);
console.log("state: ", typed_payload.state);
}
);
await install_northstar_result
.then((_message) => {
// Send notification
showNotification(this.$t('generic.done'), this.$t('settings.repair.window.reinstall_success'));
this.$store.commit('checkNorthstarUpdates');
})
.catch((error) => {
showErrorNotification(error);
console.error(error);
})
.finally(() => {
// Clear old notification
notification.close();
});
},
async cleanUpDownloadFolder() {
await invoke("clean_up_download_folder_wrapper", { gameInstall: this.$store.state.game_install, force: true }).then((_message) => {
// Show user notification if task completed.
Expand Down

0 comments on commit 45cb475

Please sign in to comment.