fix tree keyboard shortcuts propagating outside of tree

This commit is contained in:
zadam
2020-02-02 10:10:37 +01:00
parent 0054a32dc7
commit 96e2b9bc18
4 changed files with 42 additions and 24 deletions

View File

@@ -12,8 +12,10 @@ const keyboardActionsLoaded = server.get('keyboard-actions').then(actions => {
if (shortcut && !shortcut.startsWith("global:")) { // global shortcuts should be handled in the electron code
const eventName = action.actionName.charAt(0).toLowerCase() + action.actionName.slice(1);
// empty object param so that destructuring with optional params work
utils.bindGlobalShortcut(shortcut, () => appContext.trigger(eventName, {}));
if (action.scope !== 'note-tree') {
// empty object param so that destructuring with optional params work
utils.bindGlobalShortcut(shortcut, () => appContext.trigger(eventName, {}));
}
}
}
}