mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-27 11:58:49 +01:00
This commit is contained in:
parent
0929856bf4
commit
4cb2875bda
1 changed files with 12 additions and 0 deletions
|
|
@ -307,6 +307,7 @@ const openPlugin = (app: App, target: Element) => {
|
|||
app.plugins.forEach((plugin) => {
|
||||
// @ts-ignore
|
||||
const hasSetting = plugin.setting || plugin.__proto__.hasOwnProperty("openSetting");
|
||||
let hasTopBar = false;
|
||||
plugin.topBarIcons.forEach(item => {
|
||||
const hasUnpin = window.siyuan.storage[Constants.LOCAL_PLUGINTOPUNPIN].includes(item.id);
|
||||
const submenu = [{
|
||||
|
|
@ -351,7 +352,18 @@ const openPlugin = (app: App, target: Element) => {
|
|||
}
|
||||
menu.addItem(menuOption);
|
||||
hasPlugin = true;
|
||||
hasTopBar = true;
|
||||
});
|
||||
if (!hasTopBar && hasSetting) {
|
||||
hasPlugin = true;
|
||||
menu.addItem({
|
||||
icon: "iconSettings",
|
||||
label: plugin.name,
|
||||
click() {
|
||||
plugin.openSetting();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (hasPlugin) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue