Skip to content

Commit

Permalink
Resolve #1473
Browse files Browse the repository at this point in the history
  • Loading branch information
dfahlander committed Apr 27, 2022
1 parent 7e34806 commit c921a2c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/live-query/enable-broadcast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@ if (typeof BroadcastChannel !== 'undefined') {
//
// Propagate remote changes locally via storage event:
//
addEventListener('storage', (ev: StorageEvent) => {
if (ev.key === STORAGE_MUTATED_DOM_EVENT_NAME) {
const data = JSON.parse(ev.newValue);
if (data) propagateLocally(data.changedParts);
}
});
if (typeof addEventListener !== 'undefined') {
addEventListener('storage', (ev: StorageEvent) => {
if (ev.key === STORAGE_MUTATED_DOM_EVENT_NAME) {
const data = JSON.parse(ev.newValue);
if (data) propagateLocally(data.changedParts);
}
});
}

//
// Propagate messages from service worker
Expand Down

0 comments on commit c921a2c

Please sign in to comment.