mirror of
https://github.com/zadam/trilium.git
synced 2024-11-12 02:37:39 +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() {
|
function getKeyboardActions() {
|
||||||
|
if (cachedActions) {
|
||||||
|
return cachedActions;
|
||||||
|
}
|
||||||
|
|
||||||
const actions = JSON.parse(JSON.stringify(DEFAULT_KEYBOARD_ACTIONS));
|
const actions = JSON.parse(JSON.stringify(DEFAULT_KEYBOARD_ACTIONS));
|
||||||
|
|
||||||
for (const action of actions) {
|
for (const action of actions) {
|
||||||
|
@ -430,6 +436,8 @@ function getKeyboardActions() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cachedActions = actions;
|
||||||
|
|
||||||
return actions;
|
return actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue