Fix local folder title option refresh race

This commit is contained in:
lix-2026
2026-05-26 17:24:05 +08:00
parent 2c7a91e1fb
commit 58e2fdb5d8
6 changed files with 52 additions and 1 deletions
@@ -2769,6 +2769,15 @@ import { createSidebarPageSettingsRuntime } from './sidebar-page-settings-runtim
if (isPageSettingsOpen()) renderPageSettingsPopover();
selectSidebarFileTreeDocument(detail.documentId, { scrollIntoView: false });
});
window.addEventListener('mnote:page-aggregate-synced', function(event) {
var detail = event && event.detail ? event.detail : {};
if (detail.scriptId && detail.scriptId !== '__MNOTE_PAGE_AGGREGATE__') return;
var documentId = searchText(detail.documentId || '');
if (documentId && currentDocumentId() && documentId !== currentDocumentId()) return;
pageUiState.pageOptions = null;
applyPageOptionsToShell();
if (isPageSettingsOpen()) renderPageSettingsPopover();
});
restoreSidebarTreeTab();
startLocalFolderSidebarWatch();
})();