Skip to content

Commit

Permalink
chore: terse up and comment offline initialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjpillsbury committed Apr 18, 2024
1 parent c9e896b commit 2181381
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/upchunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,11 @@ export class UpChunk {
this.maxFileBytes = (options.maxFileSize || 0) * 1024;
this.chunkCount = 0;
this.attemptCount = 0;
if (typeof window !== 'undefined' && !window.navigator.onLine) {
this._offline = true;
} else {
this._offline = false;
}
// Initialize offline to the current offline state, where
// offline is false if
// 1. we're not running in the browser (aka window is undefined) -OR-
// 2. we're not online (as advertised by navigator.onLine)
this._offline = typeof window !== 'undefined' && !window.navigator.onLine;
this._paused = false;
this.success = false;
this.nextChunkRangeStart = 0;
Expand Down

0 comments on commit 2181381

Please sign in to comment.