Skip to content

Commit b17da68

Browse files
committed
Fix isOffline to return bool
1 parent 6367a1b commit b17da68

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/src/store.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,11 @@ export class Store {
339339
* not be performed client side when offline.
340340
*/
341341
public isOffline(): boolean {
342+
// If we are in a node/server environment assume we are online.
343+
if (typeof window === 'undefined') {
344+
return false;
345+
}
346+
342347
return !window?.navigator?.onLine;
343348
}
344349

0 commit comments

Comments
 (0)