Skip to content

Commit

Permalink
PWA-3285 : Update networkUtils.js to check saveData mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rudraswamy.c authored and rudraswamy.c committed May 27, 2024
1 parent 0c63b30 commit e7b7839
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
* @returns {boolean}
*/
export const isFastNetwork = () => {
if (navigator.connection && 'effectiveType' in navigator.connection) {
if (
navigator.connection ||
(navigator.connection.saveData &&
'effectiveType' in navigator.connection)
) {
return navigator.connection.effectiveType === '4g';
} else {
/**
Expand Down

0 comments on commit e7b7839

Please sign in to comment.