Second batch of review fixings. Apply suggestions from code review of branch refactor/migrate_vuex_to_pinia

Co-authored-by: Julian Stirling <julian@julianstirling.co.uk>
This commit is contained in:
Antonio Anaya 2026-04-30 17:52:13 -06:00
parent 67f253eecd
commit a7771d29ff
4 changed files with 794 additions and 985 deletions

1758
webapp/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -17,14 +17,12 @@
"dependencies": { "dependencies": {
"@vueuse/core": "^14.1.0", "@vueuse/core": "^14.1.0",
"axios": "^1.7.7", "axios": "^1.7.7",
"eslint-plugin-pinia": "^0.4.2",
"material-design-icons": "^3.0", "material-design-icons": "^3.0",
"mitt": "^3.0.1", "mitt": "^3.0.1",
"mousetrap": "^1.6.5", "mousetrap": "^1.6.5",
"openseadragon": "^5.0.0", "openseadragon": "^5.0.0",
"pinia": "^3.0.4", "pinia": "^3.0.4",
"pinia-plugin-persistedstate": "^4.7.1", "pinia-plugin-persistedstate": "^4.7.1",
"typescript-eslint": "^8.59.0",
"uikit": "^3.24.2", "uikit": "^3.24.2",
"vue": "^3.4.0", "vue": "^3.4.0",
"vue-router": "4.0.0" "vue-router": "4.0.0"
@ -38,6 +36,8 @@
"eslint": "^9.39.2", "eslint": "^9.39.2",
"eslint-plugin-prettier": "^5.1.0", "eslint-plugin-prettier": "^5.1.0",
"eslint-plugin-vue": "^9.20.0", "eslint-plugin-vue": "^9.20.0",
"eslint-plugin-pinia": "^0.4.2",
"typescript-eslint": "^8.59.0",
"less": "^4.5.1", "less": "^4.5.1",
"material-symbols": "^0.39.1", "material-symbols": "^0.39.1",
"prettier": "^3.2.8", "prettier": "^3.2.8",

View file

@ -12,7 +12,7 @@
</template> </template>
<script> <script>
import { mapState } from "pinia"; import { mapWritableState } from "pinia";
import { useSettingsStore } from "@/stores/settings.js"; import { useSettingsStore } from "@/stores/settings.js";
// Export main app // Export main app
@ -24,15 +24,7 @@ export default {
}, },
computed: { computed: {
...mapState(useSettingsStore, ["disableStream"]), ...mapWritableState(useSettingsStore, ["disableStream"]),
disableStream: {
get() {
return this.disableStream;
},
set(value) {
this.disableStream = value;
},
},
}, },
}; };
</script> </script>

View file

@ -34,7 +34,7 @@
import { eventBus } from "../../eventBus.js"; import { eventBus } from "../../eventBus.js";
import { useIntersectionObserver } from "@vueuse/core"; import { useIntersectionObserver } from "@vueuse/core";
import { useSettingsStore } from "@/stores/settings.js"; import { useSettingsStore } from "@/stores/settings.js";
import { mapState, mapWritableState } from "pinia"; import { mapState } from "pinia";
// Export main app // Export main app
export default { export default {
@ -57,8 +57,7 @@ export default {
}, },
computed: { computed: {
...mapState(useSettingsStore, ["ready", "baseUri"]), ...mapState(useSettingsStore, ["ready", "baseUri", "disableStream", "waiting"]),
...mapWritableState(useSettingsStore, ["disableStream", "waiting"]),
streamEnabled: function () { streamEnabled: function () {
return this.ready && !this.disableStream; return this.ready && !this.disableStream;
}, },