Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/16879

Vanessa235c320d9116
diff --git a/app/src/boot/globalEvent/command/global.ts b/app/src/boot/globalEvent/command/global.ts
index 409a47e654..753a6439ce 100644
--- a/app/src/boot/globalEvent/command/global.ts
+++ b/app/src/boot/globalEvent/command/global.ts
@@ -196,44 +196,40 @@ export const globalCommand = (command: string, app: App) => {
}
return true;
}
- fetchPost("/api/block/checkBlockExist", {id: childData.rootId || childData.blockId}, (response) => {
- if (response.data) {
- fetchPost("/api/block/getBlockInfo", {id: childData.rootId || childData.blockId}, (infoResponse) => {
- if (infoResponse.data.rootID === (childData.rootId || childData.blockId)) {
- if (childData.instance === "Editor") {
- openFile({
- app,
- fileName: closeData.title,
- id: childData.blockId,
- rootID: childData.rootId,
- mode: childData.mode,
- rootIcon: closeData.docIcon,
- action: [childData.action]
- });
- } else if (childData.instance === "Backlink") {
- openBacklink({
- app,
- blockId: childData.blockId,
- rootId: childData.rootId,
- title: closeData.title,
- });
- } else if (childData.instance === "Graph") {
- openGraph({
- app,
- blockId: childData.blockId,
- rootId: childData.rootId,
- title: closeData.title
- });
- } else if (childData.instance === "Outline") {
- openOutline({
- app,
- rootId: childData.blockId,
- title: closeData.title,
- isPreview: childData.isPreview
- });
- }
- }
- });
+ fetchPost("/api/block/getBlockInfo", {id: childData.rootId || childData.blockId}, (infoResponse) => {
+ if (infoResponse.data.rootID === (childData.rootId || childData.blockId)) {
+ if (childData.instance === "Editor") {
+ openFile({
+ app,
+ fileName: closeData.title,
+ id: childData.blockId,
+ rootID: childData.rootId,
+ mode: childData.mode,
+ rootIcon: closeData.docIcon,
+ action: [childData.action]
+ });
+ } else if (childData.instance === "Backlink") {
+ openBacklink({
+ app,
+ blockId: childData.blockId,
+ rootId: childData.rootId,
+ title: closeData.title,
+ });
+ } else if (childData.instance === "Graph") {
+ openGraph({
+ app,
+ blockId: childData.blockId,
+ rootId: childData.rootId,
+ title: closeData.title
+ });
+ } else if (childData.instance === "Outline") {
+ openOutline({
+ app,
+ rootId: childData.blockId,
+ title: closeData.title,
+ isPreview: childData.isPreview
+ });
+ }
}
});
}
diff --git a/app/src/layout/tabUtil.ts b/app/src/layout/tabUtil.ts
index 221b247d3b..03059b6fff 100644
--- a/app/src/layout/tabUtil.ts
+++ b/app/src/layout/tabUtil.ts
@@ -378,7 +378,6 @@ const getRootID = (item: Tab) => {
}
};
-
export const closeTabByType = (tab: Tab, type: "closeOthers" | "closeAll" | "other", tabs?: Tab[]) => {
const rootIDs: string[] = [];
if (type === "closeOthers") {