fix: check if a shortcut has an available function before trying to invoke it
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2022-01-18 21:51:24 +01:00
parent e2d9aa3d7f
commit 8233c8c953
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 2 deletions

View File

@ -4,9 +4,9 @@
<template v-for="(s, i) in shortcuts" :key="i">
<h3>{{ $t(s.title) }}</h3>
<message class="mb-4">
<message class="mb-4" v-if="s.available">
{{
s?.available($route)
s.available($route)
? $t('keyboardShortcuts.currentPageOnly')
: $t('keyboardShortcuts.allPages')
}}
@ -37,6 +37,8 @@ import Message from '@/components/misc/message.vue'
import {KEYBOARD_SHORTCUTS_ACTIVE} from '@/store/mutation-types'
import {KEYBOARD_SHORTCUTS as shortcuts} from './shortcuts'
console.log('s', shortcuts)
function close() {
store.commit(KEYBOARD_SHORTCUTS_ACTIVE, false)
}