diff --git a/src/renderer/components/general-settings/general-settings.js b/src/renderer/components/general-settings/general-settings.js index 7116bb77..884f6bd3 100644 --- a/src/renderer/components/general-settings/general-settings.js +++ b/src/renderer/components/general-settings/general-settings.js @@ -552,6 +552,9 @@ export default Vue.extend({ invidiousInstance: function () { return this.$store.getters.getInvidiousInstance }, + enableSearchSuggestions: function () { + return this.$store.getters.getEnableSearchSuggestions + }, backendFallback: function () { return this.$store.getters.getBackendFallback }, @@ -616,6 +619,7 @@ export default Vue.extend({ }, ...mapActions([ + 'updateEnableSearchSuggestions', 'updateBackendFallback', 'updateCheckForUpdates', 'updateBarColor', diff --git a/src/renderer/components/general-settings/general-settings.vue b/src/renderer/components/general-settings/general-settings.vue index 91832530..3e1c7928 100644 --- a/src/renderer/components/general-settings/general-settings.vue +++ b/src/renderer/components/general-settings/general-settings.vue @@ -12,6 +12,11 @@ :default-value="backendFallback" @change="updateBackendFallback" /> + { + return state.enableSearchSuggestions + }, + getBackendPreference: () => { return state.backendPreference }, @@ -169,6 +174,9 @@ const actions = { case 'checkForUpdates': commit('setCheckForUpdates', result.value) break + case 'enableSearchSuggestions': + commit('setEnableSearchSuggestions', result.value) + break case 'backendPreference': commit('setBackendPreference', result.value) break @@ -255,6 +263,14 @@ const actions = { }) }, + updateEnableSearchSuggestions ({ commit }, enableSearchSuggestions) { + settingsDb.update({ _id: 'enableSearchSuggestions' }, { _id: 'enableSearchSuggestions', value: enableSearchSuggestions }, { upsert: true }, (err, numReplaced) => { + if (!err) { + commit('setEnableSearchSuggestions', enableSearchSuggestions) + } + }) + }, + updateBackendPreference ({ commit }, backendPreference) { settingsDb.update({ _id: 'backendPreference' }, { _id: 'backendPreference', value: backendPreference }, { upsert: true }, (err, numReplaced) => { if (!err) { @@ -440,6 +456,9 @@ const mutations = { setBarColor (state, barColor) { state.barColor = barColor }, + setEnableSearchSuggestions (state, enableSearchSuggestions) { + state.enableSearchSuggestions = enableSearchSuggestions + }, setRememberHistory (state, rememberHistory) { state.rememberHistory = rememberHistory },