Skip to content

Commit

Permalink
feat: reset liveness after 5 minutes of initialized its component
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyArt1 committed Aug 12, 2024
1 parent c2132c5 commit 1eca56a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/LivenessModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Toolbar from '@mui/material/Toolbar';
import AppBar from '@mui/material/AppBar';
import Dialog from '@mui/material/Dialog';
import { Box } from '@mui/material';
import React from 'react';
import Image from 'next/image';

import LogoWhite from '@public/assets/logo-white.svg';
Expand All @@ -25,6 +26,13 @@ export function LivenessModal({ cedula, setOpen }: Props) {
const closeModal = () => setOpen(false);
const { intl } = useLanguage();

React.useEffect(() => {
const FIVE_MINUTES = 5 * 60 * 1000;
const timeout = setTimeout(() => window.location.reload(), FIVE_MINUTES);

return () => clearTimeout(timeout);
});

return (
<div>
<Dialog
Expand Down

0 comments on commit 1eca56a

Please sign in to comment.