Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't force full reload to show success screen
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent e0f2a79 commit dbf6434
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/routes/report.tsx
Expand Up @@ -60,11 +60,6 @@ export default function () {
};

useEffect(() => {
if (sessionStorage.getItem("REPORT_SUCCESS")) {
sessionStorage.removeItem("REPORT_SUCCESS");
return setShowSuccess(true);
}

setSupportsRequestStreams(
(() => {
let duplexAccessed = false;
Expand Down Expand Up @@ -241,6 +236,9 @@ export default function () {
method: "POST",
});

// @ts-expect-error
turnstile.reset();

return toast({
description: "Failed to upload file",
isClosable: true,
Expand All @@ -257,7 +255,7 @@ export default function () {
method: "POST",
});

sessionStorage.setItem("REPORT_SUCCESS", "1");
setShowSuccess(true);
}

useEffect(() => {
Expand Down

0 comments on commit dbf6434

Please sign in to comment.