Skip to content

Commit ccb9bf9

Browse files
Check for addEventListener() before calling (#2994)
1 parent be5bb4b commit ccb9bf9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/firestore/src/util/async_queue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export class AsyncQueue {
240240

241241
constructor() {
242242
const window = PlatformSupport.getPlatform().window;
243-
if (window) {
243+
if (window && typeof window.addEventListener === 'function') {
244244
window.addEventListener('visibilitychange', this.visibilityHandler);
245245
}
246246
}

0 commit comments

Comments
 (0)