From 1eca56ada09794fc8bf0d4b159a77af7b8f5695d Mon Sep 17 00:00:00 2001 From: Jeffrey Mesa Date: Mon, 12 Aug 2024 14:41:03 -0400 Subject: [PATCH] feat: reset liveness after 5 minutes of initialized its component --- src/components/LivenessModal/index.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/LivenessModal/index.tsx b/src/components/LivenessModal/index.tsx index cdc3e926..f37eded6 100644 --- a/src/components/LivenessModal/index.tsx +++ b/src/components/LivenessModal/index.tsx @@ -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'; @@ -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 (