From 3b73a58d884c6d6a4755fb46e3d23f477ca00e81 Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Fri, 15 Mar 2024 17:44:46 +0100 Subject: [PATCH] updating check on internet that if it's uncertain, it will return false so we don't schedule several reconnects --- src/libs/NetworkConnection.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/NetworkConnection.ts b/src/libs/NetworkConnection.ts index f5c391aad09c..6839b290abdd 100644 --- a/src/libs/NetworkConnection.ts +++ b/src/libs/NetworkConnection.ts @@ -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)); } }, }); @@ -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); }); }