fix: Fixed pinned tabs not updating sometimes, b=no-bug, c=tabs

This commit is contained in:
mr. m
2025-11-23 01:44:40 +01:00
parent 0e8b8da845
commit 3761110604

View File

@@ -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();