We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e34806 commit c921a2cCopy full SHA for c921a2c
src/live-query/enable-broadcast.ts
@@ -60,12 +60,14 @@ if (typeof BroadcastChannel !== 'undefined') {
60
//
61
// Propagate remote changes locally via storage event:
62
63
- addEventListener('storage', (ev: StorageEvent) => {
64
- if (ev.key === STORAGE_MUTATED_DOM_EVENT_NAME) {
65
- const data = JSON.parse(ev.newValue);
66
- if (data) propagateLocally(data.changedParts);
67
- }
68
- });
+ 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);
+ }
69
+ });
70
71
72
73
// Propagate messages from service worker
0 commit comments