瀏覽代碼

:bug: fix https://github.com/siyuan-note/siyuan/issues/8341 1

Vanessa 2 年之前
父節點
當前提交
da0afd39a8
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      app/src/layout/util.ts

+ 6 - 2
app/src/layout/util.ts

@@ -256,7 +256,11 @@ const pushPluginDock = (app: App, dockItem: IDockTab[], position: TPluginDockPos
             });
         }
     });
-    dockItem.forEach(existSubItem => {
+    dockItem.forEach((existSubItem, index) => {
+        if (!["file", "outline", "inbox", "bookmark", "tag", "graph", "globalGraph", "backlink"].includes(existSubItem.type)) {
+            dockItem.splice(index, 1);
+            return;
+        }
         if (existSubItem.hotkeyLangId) {
             existSubItem.title = window.siyuan.languages[existSubItem.hotkeyLangId];
             existSubItem.hotkey = window.siyuan.config.keymap.general[existSubItem.hotkeyLangId].custom;
@@ -944,7 +948,7 @@ export const newCenterEmptyTab = (app: App) => {
                 let target = event.target as HTMLElement;
                 while (target && !target.isEqualNode(tab.panelElement)) {
                     if (target.id === "editorEmptySearch") {
-                        openSearch( {
+                        openSearch({
                             app,
                             hotkey: window.siyuan.config.keymap.general.globalSearch.custom,
                         });