mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
caching parsed keyboard actions
This commit is contained in:
parent
620e896a89
commit
90622d71f8
@ -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…
x
Reference in New Issue
Block a user