diff --git a/src/components/Settings/SearchBar.vue b/src/components/Settings/SearchBar.vue index 22654b2a..42d7cc77 100644 --- a/src/components/Settings/SearchBar.vue +++ b/src/components/Settings/SearchBar.vue @@ -95,7 +95,8 @@ export default { }, /* If configured, launch specific app when hotkey pressed */ handleHotKey(key) { - const usersHotKeys = this.getCustomKeyShortcuts(); + const sections = this.$store.getters.sections || []; + const usersHotKeys = this.getCustomKeyShortcuts(sections); usersHotKeys.forEach((hotkey) => { if (hotkey.hotkey === parseInt(key, 10)) { if (hotkey.url) window.open(hotkey.url, '_blank'); diff --git a/src/utils/ConfigHelpers.js b/src/utils/ConfigHelpers.js index 544fd8e1..a2944bf1 100644 --- a/src/utils/ConfigHelpers.js +++ b/src/utils/ConfigHelpers.js @@ -1,4 +1,5 @@ import ConfigAccumulator from '@/utils/ConfigAccumalator'; +// import $store from '@/store'; import filterUserSections from '@/utils/CheckSectionVisibility'; import { languages } from '@/utils/languages'; import { @@ -77,9 +78,8 @@ export const componentVisibility = (appConfig) => { * Returns a list of items which the user has assigned a hotkey to * So that when the hotkey is pressed, the app/ service can be launched */ -export const getCustomKeyShortcuts = () => { +export const getCustomKeyShortcuts = (sections) => { const results = []; - const sections = config.sections || []; sections.forEach((section) => { const itemsWithHotKeys = section.items.filter(item => item.hotkey); results.push(itemsWithHotKeys.map(item => ({ hotkey: item.hotkey, url: item.url })));