mirror of
https://github.com/zen-browser/desktop.git
synced 2026-07-29 03:17:48 +00:00
fix: Fixed pinned tabs not updating sometimes, b=no-bug, c=tabs
This commit is contained in:
@@ -79,6 +79,7 @@ window.ZenPinnedTabsStorage = {
|
||||
async savePin(pin, notifyObservers = true) {
|
||||
// If we find the exact same pin in the cache, skip saving
|
||||
const existingIndex = this._saveCache.findIndex((cachedPin) => cachedPin.uuid === pin.uuid);
|
||||
const copy = { ...pin };
|
||||
if (existingIndex !== -1) {
|
||||
const existingPin = this._saveCache[existingIndex];
|
||||
const isSame = Object.keys(pin).every((key) => pin[key] === existingPin[key]);
|
||||
@@ -86,11 +87,11 @@ window.ZenPinnedTabsStorage = {
|
||||
return; // No changes, skip saving
|
||||
} else {
|
||||
// Update the cached pin
|
||||
this._saveCache[existingIndex] = pin;
|
||||
this._saveCache[existingIndex] = { ...copy };
|
||||
}
|
||||
} else {
|
||||
// Add to cache
|
||||
this._saveCache.push(pin);
|
||||
this._saveCache.push(copy);
|
||||
}
|
||||
|
||||
const changedUUIDs = new Set();
|
||||
|
||||
Reference in New Issue
Block a user