Skip to content

Commit

Permalink
revert multi-if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeed committed Dec 11, 2018
1 parent 06a9a0a commit cbe616a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/prefetch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,14 @@ function prefetcher(url, isPriority) {
}

if ('connection' in navigator) {
// Don't prefetch if the user is on 2G or if Save-Data is enabled...
if ((navigator.connection.effectiveType || '').includes('2g') || navigator.connection.saveData) return;
// Don't prefetch if the user is on 2G...
if ((navigator.connection.effectiveType || '').includes('2g')) {
return;
}
// Don't prefetch ifSave-Data is enabled...
if (navigator.connection.saveData) {
return;
}
}

// Wanna do something on catch()?
Expand Down

0 comments on commit cbe616a

Please # to comment.