mirror of
https://github.com/zen-browser/desktop.git
synced 2026-06-13 15:03:41 +00:00
gh-9540: duplicated bookmarks on macOS window reopen (gh-14113)
Signed-off-by: Dan Xin <davinci42.cn@gmail.com>
This commit is contained in:
@@ -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());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user