diff options
author | GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> | 2022-10-18 23:33:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-18 23:33:38 +0200 |
commit | 546d1908b15fc7c21b1b5f0109826fb03a5493fd (patch) | |
tree | c44daa3d0e550eaa3ff1397909bbc9564012d53f /src-vue/src/views | |
parent | c4ce52bb45f0dcda8ea924694b48a8e0501d57c0 (diff) | |
download | FlightCore-546d1908b15fc7c21b1b5f0109826fb03a5493fd.tar.gz FlightCore-546d1908b15fc7c21b1b5f0109826fb03a5493fd.zip |
feat: Add persistent store (#16)
* refactor: Rename object field
So that is specifically references Northstar
* chore: Add plugin-store as npm dependency
* feat: Persistent storing selected NS release canal
* docs: Add explanation about persistent store
Diffstat (limited to 'src-vue/src/views')
-rw-r--r-- | src-vue/src/views/DeveloperView.vue | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src-vue/src/views/DeveloperView.vue b/src-vue/src/views/DeveloperView.vue index 92364679..80390432 100644 --- a/src-vue/src/views/DeveloperView.vue +++ b/src-vue/src/views/DeveloperView.vue @@ -31,6 +31,8 @@ import { invoke } from "@tauri-apps/api"; import { ElNotification } from "element-plus"; import { ReleaseCanal } from "../utils/ReleaseCanal"; import { GameInstall } from "../utils/GameInstall"; +import { Store } from 'tauri-plugin-store-api'; +const persistentStore = new Store('flight-core-settings.json'); export default defineComponent({ name: "DeveloperView", @@ -67,10 +69,13 @@ export default defineComponent({ }, async toggleReleaseCandidate() { // Flip between RELEASE and RELEASE_CANDIDATE - this.$store.state.release_canal = this.$store.state.release_canal === ReleaseCanal.RELEASE + this.$store.state.northstar_release_canal = this.$store.state.northstar_release_canal === ReleaseCanal.RELEASE ? ReleaseCanal.RELEASE_CANDIDATE : ReleaseCanal.RELEASE; + // Save change in persistent store + await persistentStore.set('northstar-release-canal', { value: this.$store.state.northstar_release_canal }); + // Update current state so that update check etc can be performed this.$store.commit("checkNorthstarUpdates"); @@ -78,8 +83,8 @@ export default defineComponent({ // Display notification to highlight change ElNotification({ - title: `${this.$store.state.release_canal}`, - message: `Switched release channel to: "${this.$store.state.release_canal}"`, + title: `${this.$store.state.northstar_release_canal}`, + message: `Switched release channel to: "${this.$store.state.northstar_release_canal}"`, type: 'success', position: 'bottom-right' }); |