This commit is contained in:
Vanessa 2023-06-22 23:06:10 +08:00
parent 0929856bf4
commit 4cb2875bda

View file

@ -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) {