Skip to content

Commit f42f9c5

Browse files
committed
lint
1 parent 5c9e830 commit f42f9c5

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/protocols/abstract/Realtime.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,13 @@ export abstract class BaseProtocolRealtime extends KuzzleAbstractProtocol {
8383
if (this.autoReconnect && !this.retrying && !this.stopRetryingToConnect) {
8484
this.retrying = true;
8585

86+
const window = getBrowserWindow();
8687
if (
8788
isBrowser() &&
88-
typeof getBrowserWindow()!.navigator === "object" &&
89-
getBrowserWindow()!.navigator.onLine === false
89+
typeof window.navigator === "object" &&
90+
window.navigator.onLine === false
9091
) {
91-
getBrowserWindow()!.addEventListener(
92+
window.addEventListener(
9293
"online",
9394
() => {
9495
this.retrying = false;

src/utils/browser.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ export function getBrowserWindow(): Window | undefined {
3030
}
3131

3232
export function isBrowser(): boolean {
33-
const window = getBrowserWindow()
33+
const window = getBrowserWindow();
3434

35-
return window !== undefined
36-
&& typeof window === 'object';
37-
}
35+
return window !== undefined && window !== null && typeof window === "object";
36+
}

src/utils/debug.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function shouldDebug() {
2323

2424
return NODE_DEBUG;
2525
}
26-
26+
2727
const window = getBrowserWindow();
2828
return (
2929
window.debugKuzzleSdk ||

0 commit comments

Comments
 (0)