Skip to content

Commit

Permalink
Merge pull request #38409 from Expensify/dsilva_improveCheckForConnec…
Browse files Browse the repository at this point in the history
…tivity

Updating check to only set status as online if we're sure we're online
  • Loading branch information
mountiny authored Mar 15, 2024
2 parents c5634fd + 3b73a58 commit 9e1ca5c
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 9e1ca5c

Please sign in to comment.