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

[INJIVER-387] fix offline screen rendering #236

Merged
Merged
Changes from all commits
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
18 changes: 17 additions & 1 deletion ui/src/components/SomethingWentWrong/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
import React from 'react';
import React, { useEffect } from 'react';
import StyledButton from "../Home/VerificationSection/commons/StyledButton";
import {useNavigate} from "react-router-dom";
import {useAppDispatch} from "../../redux/hooks";
import {updateInternetConnectionStatus} from "../../redux/features/application-state/application-state.slice";
import { ReactComponent as UnderConstruction } from "../../assets/images/under-construction.svg";
import { useTranslation } from 'react-i18next';
import { checkInternetStatus } from '../../utils/misc';

function SomethingWentWrong(props: any) {
const navigate = useNavigate();
const dispatch = useAppDispatch();
const {t} = useTranslation('Offline')
useEffect(() => {
async function fetchIsOnline() {
let isOnline = await checkInternetStatus();
dispatch(
updateInternetConnectionStatus({
internetConnectionStatus: isOnline ? "ONLINE" : "OFFLINE",
})
);
if (isOnline) {
navigate("/");
}
}
fetchIsOnline();

}, [dispatch, navigate]);
return (
<div className="grid content-center justify-center rounded-[10px] h-[540px] mx-auto my-7 shadow-lg text-center w-[90%] bg-white bg-no-repeat bg-clip-padding px-6">
<div className="col-end-13">
Expand Down
Loading