Fix persistance in pinia store

This commit is contained in:
Julian Stirling 2026-04-30 09:44:41 +01:00
parent 793441aadf
commit ebd67cd410
3 changed files with 114 additions and 102 deletions

View file

@ -31,7 +31,7 @@ export default {
methods: { methods: {
overrideAPIHost(event) { overrideAPIHost(event) {
if (this.reloadWhenOverridingOrigin) { if (!this.reloadWhenOverridingOrigin) {
this.origin = this.overrideOrigin; this.origin = this.overrideOrigin;
event.preventDefault(); event.preventDefault();
} }

View file

@ -99,7 +99,13 @@ export const useSettingsStore = defineStore(
{ {
// PiniaPluginPersistedState will now automatically persist ONLY these specific refs to localStorage // PiniaPluginPersistedState will now automatically persist ONLY these specific refs to localStorage
persist: { persist: {
paths: ["appTheme", "disableStream", "navigationStepSize", "navigationInvert"], pick: [
"appTheme",
"overrideOrigin",
"disableStream",
"navigationStepSize",
"navigationInvert",
],
}, },
}, },
); );

View file

@ -2,7 +2,9 @@ import { defineStore } from "pinia";
import { ref, computed } from "vue"; import { ref, computed } from "vue";
import axios from "axios"; import axios from "axios";
export const useWotStore = defineStore("wot", () => { export const useWotStore = defineStore(
"wot",
() => {
// State // State
const thingDescriptions = ref({}); const thingDescriptions = ref({});
const servient = ref(null); const servient = ref(null);
@ -109,7 +111,11 @@ export const useWotStore = defineStore("wot", () => {
removeAllThingDescriptions, removeAllThingDescriptions,
thingAffordanceAvailable, thingAffordanceAvailable,
}; };
}); },
{
persist: false,
},
);
export function findFormHref(affordance, op) { export function findFormHref(affordance, op) {
// Find the form in the affordance that matches the given operation type // Find the form in the affordance that matches the given operation type