mirror of
https://github.com/zadam/trilium.git
synced 2025-02-23 14:35:40 +08:00
caching parsed keyboard actions
This commit is contained in:
parent
620e896a89
commit
90622d71f8
1 changed files with 8 additions and 0 deletions
|
@ -402,7 +402,13 @@ for (const action of DEFAULT_KEYBOARD_ACTIONS) {
|
|||
}
|
||||
}
|
||||
|
||||
let cachedActions = null;
|
||||
|
||||
function getKeyboardActions() {
|
||||
if (cachedActions) {
|
||||
return cachedActions;
|
||||
}
|
||||
|
||||
const actions = JSON.parse(JSON.stringify(DEFAULT_KEYBOARD_ACTIONS));
|
||||
|
||||
for (const action of actions) {
|
||||
|
@ -430,6 +436,8 @@ function getKeyboardActions() {
|
|||
}
|
||||
}
|
||||
|
||||
cachedActions = actions;
|
||||
|
||||
return actions;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue