Skip to content

Commit

Permalink
Remove duplicate preview parameter retrieval in Vote component
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanGrims committed Dec 10, 2024
1 parent a775e1b commit d88e254
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Vote.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export default function Vote() {
document.title = title;
}, [title]);

const preview = urlParams.get("preview");


if (localStorage.getItem(id) && !urlParams.get("preview")) {
if (urlParams.get("allowResubmission")) {
navigate(`/x/${id}?allowResubmission=true`);
Expand All @@ -73,7 +76,6 @@ export default function Vote() {
navigate("/");
}

const preview = urlParams.get("preview");

const submitDisabled = () => {
if (
Expand Down

0 comments on commit d88e254

Please sign in to comment.