From dbf64347bee28d7eb36f2af88115c7036f451cd9 Mon Sep 17 00:00:00 2001 From: regalijan Date: Thu, 19 Oct 2023 16:50:17 -0400 Subject: [PATCH] Don't force full reload to show success screen --- app/routes/report.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/routes/report.tsx b/app/routes/report.tsx index a803a15..833727c 100644 --- a/app/routes/report.tsx +++ b/app/routes/report.tsx @@ -60,11 +60,6 @@ export default function () { }; useEffect(() => { - if (sessionStorage.getItem("REPORT_SUCCESS")) { - sessionStorage.removeItem("REPORT_SUCCESS"); - return setShowSuccess(true); - } - setSupportsRequestStreams( (() => { let duplexAccessed = false; @@ -241,6 +236,9 @@ export default function () { method: "POST", }); + // @ts-expect-error + turnstile.reset(); + return toast({ description: "Failed to upload file", isClosable: true, @@ -257,7 +255,7 @@ export default function () { method: "POST", }); - sessionStorage.setItem("REPORT_SUCCESS", "1"); + setShowSuccess(true); } useEffect(() => {