Skip to content

Commit

Permalink
fix: Network error in app container
Browse files Browse the repository at this point in the history
  • Loading branch information
SPageot committed Dec 29, 2021
1 parent 7835299 commit 248a3c4
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/navigation/AppNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ import { AppContainer, Modal } from '../components';

const AppNavigator = () => {
const [confirmNetworkError, setConfirmNetworkError] = useState(false);
const { showProgressOverlay, connectionCheck } = useSelector(store => store.app);

if (!connectionCheck && !confirmNetworkError) {
return (
const { showProgressOverlay, connectionCheck } = useSelector(
store => store.app,
);
return (
<AppContainer>
{showProgressOverlay && <IndeterminateProgressOverlay />}
{!connectionCheck && !confirmNetworkError && (
<Modal
type="error"
onOk={() => setConfirmNetworkError(true)}
Expand All @@ -21,12 +24,7 @@ const AppNavigator = () => {
'There is a connection error. The Climate Warehouse is inaccessible'
}
/>
);

}
return (
<AppContainer>
{showProgressOverlay && <IndeterminateProgressOverlay />}
)}
<Router>
<Dashboard>
<Suspense fallback={<IndeterminateProgressOverlay />}>
Expand Down

0 comments on commit 248a3c4

Please sign in to comment.