aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-03-27 17:58:26 +0200
committerGitHub <noreply@github.com>2023-03-27 15:58:26 +0000
commit12741098da937ab55d2e1292631217b3a21a3ffa (patch)
treea7dd4d84cfbd9d6bcfa1063ce1e9fa3f4fd502e1 /src-vue/src
parentcec86b682d68016e2142b27e7674d77807c3330c (diff)
downloadFlightCore-12741098da937ab55d2e1292631217b3a21a3ffa.tar.gz
FlightCore-12741098da937ab55d2e1292631217b3a21a3ffa.zip
fix: Address regression around persistent store (#227)
* fix: Pin tauri-plugin-store package to same commit Pin npm package to same commit as Rust crate * fix: Attempt using newest plugin store commit * fix: Perform explicit save to store on each change This seems to resolve the issue around no longer writing changes to store on close as now values are written on each change. * chore: Pin dependencies to specific commit Instead of tracking a branch, track a specific commit
Diffstat (limited to 'src-vue/src')
-rw-r--r--src-vue/src/plugins/store.ts3
-rw-r--r--src-vue/src/views/SettingsView.vue6
2 files changed, 7 insertions, 2 deletions
diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts
index d5b7c5d8..caa46bee 100644
--- a/src-vue/src/plugins/store.ts
+++ b/src-vue/src/plugins/store.ts
@@ -143,6 +143,7 @@ export const store = createStore<FlightCoreStore>({
// Save change in persistent store
await persistentStore.set('game-install', { value: game_install });
+ await persistentStore.save(); // explicit save to disk
// Check for Northstar install
store.commit('checkNorthstarUpdates');
@@ -307,6 +308,7 @@ export const store = createStore<FlightCoreStore>({
// Save change in persistent store
await persistentStore.set('northstar-release-canal', { value: state.northstar_release_canal });
+ await persistentStore.save(); // explicit save to disk
// Update current state so that update check etc can be performed
store.commit("checkNorthstarUpdates");
@@ -407,6 +409,7 @@ async function _initializeApp(state: any) {
// Save change in persistent store
await persistentStore.set('game-install', { value: typedResult });
+ await persistentStore.save(); // explicit save to disk
// Update UI store
state.game_path = typedResult.game_path;
diff --git a/src-vue/src/views/SettingsView.vue b/src-vue/src/views/SettingsView.vue
index c93d69ff..4e816740 100644
--- a/src-vue/src/views/SettingsView.vue
+++ b/src-vue/src/views/SettingsView.vue
@@ -78,9 +78,10 @@ export default defineComponent({
get(): boolean {
return this.$store.state.enableReleasesSwitch;
},
- set(value: boolean): void {
+ async set(value: boolean): Promise<void> {
this.$store.state.enableReleasesSwitch = value;
persistentStore.set('northstar-releases-switching', { value });
+ await persistentStore.save(); // explicit save to disk
// When disabling switch, we switch release canal to stable release, to avoid users being
// stuck with release candidate after disabling release switching.
@@ -93,9 +94,10 @@ export default defineComponent({
get(): number {
return this.$store.state.mods_per_page;
},
- set(value: number) {
+ async set(value: number) {
this.$store.state.mods_per_page = value;
persistentStore.set('thunderstore-mods-per-page', { value });
+ await persistentStore.save(); // explicit save to disk
}
}
},