Skip to content

Commit

Permalink
updating check on internet that if it's uncertain, it will return fal…
Browse files Browse the repository at this point in the history
…se so we don't schedule several reconnects
  • Loading branch information
danieldoglas committed Mar 15, 2024
1 parent 8b54aff commit 3b73a58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/NetworkConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Onyx.connect({
setOfflineStatus(true);
} else {
// If we are no longer forcing offline fetch the NetInfo to set isOffline appropriately
NetInfo.fetch().then((state) => setOfflineStatus(state.isInternetReachable === false));
NetInfo.fetch().then((state) => setOfflineStatus((state.isInternetReachable ?? false) === false));
}
},
});
Expand Down Expand Up @@ -106,7 +106,7 @@ function subscribeToNetInfo(): void {
Log.info('[NetworkConnection] Not setting offline status because shouldForceOffline = true');
return;
}
setOfflineStatus(state.isInternetReachable === false);
setOfflineStatus((state.isInternetReachable ?? false) === false);
});
}

Expand Down

0 comments on commit 3b73a58

Please sign in to comment.