Skip to content

Commit

Permalink
PWA-3285 : checked undefined condition for saveData and effectiveType
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 e7b7839 commit ca5627e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
*/
export const isFastNetwork = () => {
if (
navigator.connection ||
(navigator.connection.saveData &&
'effectiveType' in navigator.connection)
navigator.connection &&
navigator.connection.saveData !== undefined &&
navigator.connection.effectiveType !== undefined
) {
return navigator.connection.effectiveType === '4g';
} else {
Expand Down

0 comments on commit ca5627e

Please sign in to comment.