From 331fe293efbdea08f7a9dd60a37c3b8ac20106a9 Mon Sep 17 00:00:00 2001 From: Markus Johansen Date: Tue, 25 Jul 2023 13:27:49 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Brukeren=20sendes=20tilbake=20til?= =?UTF-8?q?=20hovedmeny=20ved=20suksessful=20innmelding,=20etter=20fem=20s?= =?UTF-8?q?ekunder.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sindre Kjelsrud --- frontend/src/pages/feil.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/feil.tsx b/frontend/src/pages/feil.tsx index 72ea8fd..2ecc399 100644 --- a/frontend/src/pages/feil.tsx +++ b/frontend/src/pages/feil.tsx @@ -36,8 +36,12 @@ export default function Feil() { const handleAlerts = () => { if (status === 201) { console.log("Feil lagt til i database"); - return Feil er meldt inn! Du vil nå sendes tilbake til hovedmenyen. - //TODO wait 5 seconds and redirect to home + setTimeout(() => + { + navigate("/"); + }, + 5000); + return Feil er meldt inn! Du vil nå sendes tilbake til hovedmenyen om fem sekunder. } else { console.log("Noe gikk galt, feil ikke lagt til i database!"); return Noe gikk galt! Prøv igjen om noen minutter.