gh-9540: duplicated bookmarks on macOS window reopen (gh-14113)

Signed-off-by: Dan Xin <davinci42.cn@gmail.com>
This commit is contained in:
Dan Xin
2026-06-12 02:05:25 +08:00
committed by GitHub
parent d5cbe55d2b
commit 88b294364f

View File

@@ -100,7 +100,16 @@ class ZenStartup {
delete this.promiseInitializedResolve;
setTimeout(() => {
gZenWorkspaces._invalidateBookmarkContainers();
// Wait for the natural PlacesToolbar rebuild before invalidating, so
// the two async rebuilds don't interleave and duplicate bookmarks.
// promiseRebuilt() returns undefined when no rebuild is in flight.
const rebuilt =
document
.getElementById("PlacesToolbar")
?._placesView?.promiseRebuilt() ?? Promise.resolve();
rebuilt
.catch(console.error)
.then(() => gZenWorkspaces._invalidateBookmarkContainers());
});
});
}