Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: App is stuck offline after 'Force offline' toggled on and off #43159

Merged
merged 5 commits into from
Jun 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/libs/NetworkConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ Onyx.connect({
} else {
// If we are no longer forcing offline fetch the NetInfo to set isOffline appropriately
NetInfo.fetch().then((state) => {
const isInternetReachable = Boolean(state.isInternetReachable);
setOfflineStatus(isInternetReachable);
const isInternetReachable = state.isInternetReachable;
setOfflineStatus((isInternetReachable ?? false) === false);
Log.info(
`[NetworkStatus] The force-offline mode was turned off. Getting the device network status from NetInfo. Network state: ${JSON.stringify(
state,
)}. Setting the offline status to: ${isInternetReachable}.`,
)}. Setting the offline status to: ${!!isInternetReachable}.`,
nkdengineer marked this conversation as resolved.
Show resolved Hide resolved
);
});
}
Expand Down
Loading