handle null object on get user

This commit is contained in:
ammarahm-ed
2020-06-21 10:36:41 +05:00
parent 4efede61b7
commit 81fb238e96

View File

@@ -27,17 +27,16 @@ const App = () => {
useEffect(() => {
if (!netInfo.isConnected || !netInfo.isInternetReachable) {
db.user.get().then(user => {
db.user?.get().then(user => {
if (user) {
ToastEvent.show('No internet connection','error');
} else {
}
});
} else {
db.user.get().then(user => {
db.user?.get().then(user => {
if (user) {
ToastEvent.show('Internet connection restored');
ToastEvent.show('Internet connection restored','success');
} else {
}