bind goToLinkEnabled to Vuex/appConfig and support persistent toggle

This commit is contained in:
Wu Baiyang (Student) 2025-09-09 04:50:52 +12:00
parent 43f4b161a0
commit 5d4b3de429

View file

@ -55,7 +55,8 @@
<label class="theme-label">
<input
type="checkbox"
v-model="goToLinkEnabled"
:checked="goToLinkEnabled"
@change="goToLinkEnabled = $event.target.checked"
/>
Go to Link (auto-detect links)
</label>
@ -92,7 +93,7 @@ export default {
akn: new ArrowKeyNavigation(),
getCustomKeyShortcuts,
showSearchPanel: false,
goToLinkEnabled: true, // default: enabled
// goToLinkEnabled is now managed by Vuex/appConfig
};
},
computed: {
@ -102,6 +103,20 @@ export default {
searchPrefs() {
return this.$store.getters.webSearch || {};
},
goToLinkEnabled: {
get() {
return this.$store.getters.goToLinkEnabled;
},
set(value) {
this.$store.commit('setGoToLinkEnabled', value);
// Also update appConfig in store for persistence
const newAppConfig = {
...this.$store.getters.appConfig,
goToLinkEnabled: value,
};
this.$store.commit('SET_APP_CONFIG', newAppConfig);
},
},
},
mounted() {
window.addEventListener('keydown', this.handleKeyPress);