mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
Merge pull request #3033 from kristijanribaric/fix/restore-pinned-tabs-to-base-url-on-startup-when-setting-is-checked
Fix: Restore pinned tabs to their pinned URLs on startup if the option is checked
This commit is contained in:
@@ -68,9 +68,9 @@
|
||||
return this._enabled;
|
||||
}
|
||||
|
||||
async _refreshPinnedTabs() {
|
||||
async _refreshPinnedTabs({ init = false } = {}) {
|
||||
await this._initializePinsCache();
|
||||
this._initializePinnedTabs();
|
||||
this._initializePinnedTabs(init);
|
||||
}
|
||||
|
||||
async _initializePinsCache() {
|
||||
@@ -109,7 +109,7 @@
|
||||
return this._pinsCache;
|
||||
}
|
||||
|
||||
_initializePinnedTabs() {
|
||||
_initializePinnedTabs(init = false) {
|
||||
const pins = this._pinsCache;
|
||||
if (!pins?.length) {
|
||||
return;
|
||||
@@ -130,6 +130,10 @@
|
||||
// This is a valid pinned tab that matches a pin
|
||||
pinnedTabsByUUID.set(pinId, tab);
|
||||
pinsToCreate.delete(pinId);
|
||||
|
||||
if(lazy.zenPinnedTabRestorePinnedTabsToPinnedUrl && init) {
|
||||
this._resetTabToStoredState(tab);
|
||||
}
|
||||
} else {
|
||||
// This is a pinned tab that no longer has a corresponding pin
|
||||
gBrowser.removeTab(tab);
|
||||
|
@@ -48,7 +48,7 @@ var ZenPinnedTabsStorage = {
|
||||
CREATE INDEX IF NOT EXISTS idx_zen_pins_changes_uuid ON zen_pins_changes(uuid)
|
||||
`);
|
||||
|
||||
await gZenPinnedTabManager._refreshPinnedTabs();
|
||||
await gZenPinnedTabManager._refreshPinnedTabs({init: true});
|
||||
});
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user