From 2b98754c6e46363df76715f482ef3584882bfc48 Mon Sep 17 00:00:00 2001 From: Oscar Franco Date: Tue, 26 Sep 2023 13:30:02 +0200 Subject: [PATCH] Propagate merge events accross tabs --- lib/storage/WebStorage.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/storage/WebStorage.js b/lib/storage/WebStorage.js index 6b4889f90..b3e2c11e2 100644 --- a/lib/storage/WebStorage.js +++ b/lib/storage/WebStorage.js @@ -40,6 +40,9 @@ const webStorage = { this.removeItems = keys => Storage.removeItems(keys) .then(() => raiseStorageSyncManyKeysEvent(keys)); + this.mergeItem = (key, batchedChanges, modifiedData) => Storage.mergeItem(key, batchedChanges, modifiedData) + .then(() => raiseStorageSyncEvent(key)); + // If we just call Storage.clear other tabs will have no idea which keys were available previously // so that they can call keysChanged for them. That's why we iterate over every key and raise a storage sync // event for each one