Skip to content

Commit

Permalink
fix: fix networking issue preventing initial login
Browse files Browse the repository at this point in the history
  • Loading branch information
mclaughlinconnor committed Apr 29, 2022
1 parent 54e75b9 commit 53fbfd9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,22 @@ export default function App() {

setIsLoggedIn(true);

await SplashScreen.hideAsync();
} else {
await realmApp.currentUser?.logOut()
}
});
}, [networkState?.isInternetReachable]);

useEffect(() => {
if (networkState && !networkState.isInternetReachable) {
ToastAndroid.show('There is no internet connection, try again later', ToastAndroid.LONG);
const handle = async () => {
if (networkState && !networkState.isInternetReachable) {
ToastAndroid.show('There is no internet connection, try again later', ToastAndroid.LONG);
} else {
await SplashScreen.hideAsync();
}
}

handle().then(() => console.log('Handled network event'))
}, [networkState?.isInternetReachable])

if (!isLoadingComplete || !networkState?.isInternetReachable) {
Expand Down

0 comments on commit 53fbfd9

Please sign in to comment.