|
@@ -74,7 +74,9 @@ export class Toolbar {
|
|
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
|
|
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- toolbarItem.hotkey = window.siyuan.config.keymap.plugin[item.name][toolbarItem.name].custom;
|
|
|
|
|
|
+ if (window.siyuan.config.keymap.plugin && window.siyuan.config.keymap.plugin[item.name] && window.siyuan.config.keymap.plugin[item.name][toolbarItem.name]) {
|
|
|
|
+ toolbarItem.hotkey = window.siyuan.config.keymap.plugin[item.name][toolbarItem.name].custom;
|
|
|
|
+ }
|
|
})
|
|
})
|
|
options.toolbar = toolbarKeyToMenu(pluginToolbar);
|
|
options.toolbar = toolbarKeyToMenu(pluginToolbar);
|
|
});
|
|
});
|
|
@@ -93,7 +95,9 @@ export class Toolbar {
|
|
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
|
|
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- toolbarItem.hotkey = window.siyuan.config.keymap.plugin[item.name][toolbarItem.name].custom;
|
|
|
|
|
|
+ if (window.siyuan.config.keymap.plugin && window.siyuan.config.keymap.plugin[item.name] && window.siyuan.config.keymap.plugin[item.name][toolbarItem.name]) {
|
|
|
|
+ toolbarItem.hotkey = window.siyuan.config.keymap.plugin[item.name][toolbarItem.name].custom;
|
|
|
|
+ }
|
|
})
|
|
})
|
|
protyle.options.toolbar = toolbarKeyToMenu(pluginToolbar);
|
|
protyle.options.toolbar = toolbarKeyToMenu(pluginToolbar);
|
|
});
|
|
});
|