mirror of
https://github.com/zen-browser/desktop
synced 2026-04-25 17:15:00 +02:00
gh-9540: Fixed duplicate bookmarks appearing on startup (gh-13232)
This commit is contained in:
@@ -98,6 +98,10 @@ class ZenStartup {
|
||||
this.isReady = true;
|
||||
this.promiseInitializedResolve();
|
||||
delete this.promiseInitializedResolve;
|
||||
|
||||
setTimeout(() => {
|
||||
gZenWorkspaces._invalidateBookmarkContainers();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ window.ZenWorkspaceBookmarksStorage = {
|
||||
timestamp INTEGER NOT NULL,
|
||||
UNIQUE(bookmark_guid),
|
||||
FOREIGN KEY(bookmark_guid) REFERENCES moz_bookmarks(guid) ON DELETE CASCADE
|
||||
)
|
||||
)
|
||||
`);
|
||||
|
||||
// Create index for changes tracking
|
||||
|
||||
@@ -2475,14 +2475,14 @@ class nsZenWorkspaces {
|
||||
this._workspaceBookmarksCache?.bookmarks || {}
|
||||
).length;
|
||||
if (!onInit || hasWorkspaceBookmarks) {
|
||||
this.#invalidateBookmarkContainers();
|
||||
this._invalidateBookmarkContainers();
|
||||
}
|
||||
|
||||
// Update workspace indicator
|
||||
await this.updateWorkspaceIndicator(workspace, this.workspaceIndicator);
|
||||
|
||||
// Fix ctrl+tab behavior. Note, we dont call it with "await" because we dont want to wait for it
|
||||
this._fixCtrlTabBehavior();
|
||||
this.#fixCtrlTabBehavior();
|
||||
|
||||
// Bug: When updating from previous versions, we used to hide the tabs not used in the new workspace
|
||||
// we now need to show them again.
|
||||
@@ -2512,12 +2512,13 @@ class nsZenWorkspaces {
|
||||
);
|
||||
}
|
||||
|
||||
async _fixCtrlTabBehavior() {
|
||||
// Intentionally keep it as async!
|
||||
async #fixCtrlTabBehavior() {
|
||||
ctrlTab.uninit();
|
||||
ctrlTab.readPref();
|
||||
}
|
||||
|
||||
#invalidateBookmarkContainers() {
|
||||
_invalidateBookmarkContainers() {
|
||||
for (let i = 0, len = this.bookmarkMenus.length; i < len; i++) {
|
||||
const element = document.getElementById(this.bookmarkMenus[i]);
|
||||
if (element && element._placesView) {
|
||||
|
||||
Reference in New Issue
Block a user