From e40baf4bcb2de4e5427b6a0b90e694b2ae78c35a Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 19 Mar 2026 13:35:13 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/16082 --- app/src/layout/dock/Files.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts index db4c43d4a..5cbd06589 100644 --- a/app/src/layout/dock/Files.ts +++ b/app/src/layout/dock/Files.ts @@ -914,6 +914,7 @@ data-type="navigation-root" data-path="/"> let html = ""; let closeHtml = ""; let closeCounter = 0; + const scrollTop = this.element.scrollTop; window.siyuan.notebooks.forEach((item) => { if (item.closed) { closeCounter++; @@ -931,10 +932,11 @@ data-type="navigation-root" data-path="/"> } else { this.closeElement.classList.add("fn__none"); } - window.siyuan.storage[Constants.LOCAL_FILESPATHS].forEach((item: IFilesPath) => { - item.openPaths.forEach((openPath) => { - this.selectItem(item.notebookId, openPath, undefined, false, false); - }); + window.siyuan.storage[Constants.LOCAL_FILESPATHS].forEach(async (item: IFilesPath) => { + for (const openPath of item.openPaths) { + await this.selectItem(item.notebookId, openPath, undefined, false, false); + } + this.element.scrollTop = scrollTop; }); this.refreshPublishAccessSwitch(); if (!init) {