From 262650dfab80bc625d77a06b37b27a080a5e2030 Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:10:27 +0800 Subject: [PATCH] fix: unregister note preview section when closing workspace fix: #996 --- src/modules/workspace/preview.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/workspace/preview.ts b/src/modules/workspace/preview.ts index 4260ec7..ef16ffa 100644 --- a/src/modules/workspace/preview.ts +++ b/src/modules/workspace/preview.ts @@ -111,6 +111,9 @@ export function openNotePreview( ); } }, + onDestroy: () => { + Zotero.ItemPaneManager.unregisterSection(key || ""); + }, }); const workspace = getWorkspaceByUID(workspaceUID);