Skip to content

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

:bug: Hide unpin action when selected documents are not pinned https://github.com/siyuan-note/siyuan/issues/19629

Danielfa92f6c6ddd8
diff --git a/app/src/menus/navigation.ts b/app/src/menus/navigation.ts
index 908f3e8891..7df4597062 100644
--- a/app/src/menus/navigation.ts
+++ b/app/src/menus/navigation.ts
@@ -312,12 +312,14 @@ const initMultiMenu = (selectItemElements: NodeListOf<HTMLElement>, app: App) =>
click: () => { updatePinnedDocs(blockIDs, "pin"); },
}).element);
}
- window.siyuan.menus.menu.append(new MenuItem({
- id: "unpinDoc",
- icon: "iconUnpin",
- label: window.siyuan.languages.unpinDoc,
- click: () => { updatePinnedDocs(blockIDs, "unpin"); },
- }).element);
+ if (blockIDs.some(id => pinnedDocIDs.has(id))) {
+ window.siyuan.menus.menu.append(new MenuItem({
+ id: "unpinDoc",
+ icon: "iconUnpin",
+ label: window.siyuan.languages.unpinDoc,
+ click: () => { updatePinnedDocs(blockIDs, "unpin"); },
+ }).element);
+ }
}
window.siyuan.menus.menu.append(new MenuItem({id: "separator_1", type: "separator"}).element);
if (!window.siyuan.config.readonly && !isEncryptedBox(notebookId)) {