From 5d4b3de42940b551be3b41655563dcb98a15b198 Mon Sep 17 00:00:00 2001 From: "Wu Baiyang (Student)" Date: Tue, 9 Sep 2025 04:50:52 +1200 Subject: [PATCH] bind goToLinkEnabled to Vuex/appConfig and support persistent toggle --- src/components/Settings/SearchBar.vue | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/components/Settings/SearchBar.vue b/src/components/Settings/SearchBar.vue index cf4dc338..0a461e72 100644 --- a/src/components/Settings/SearchBar.vue +++ b/src/components/Settings/SearchBar.vue @@ -55,7 +55,8 @@ @@ -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);