Skip to content

Commit

Permalink
submit form and close dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
LMacPhail committed Feb 9, 2024
1 parent 8c5643d commit 5020f8c
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/components/auth/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export function Account({ session }: { session: Session }) {
alert(error.message);
}
setLoading(false);

// @ts-expect-error
document?.getElementById("sign_up_modal")?.close();
localStorage.setItem(MODAL_DISMISSED_KEY, "true");
}

return (
Expand Down Expand Up @@ -122,16 +126,13 @@ export function Account({ session }: { session: Session }) {
onChange={(e) => setForm({ ...form, purpose: e.target.value })}
/>

<form method="dialog">
<button
className="btn btn-sm primary mt-8"
type="submit"
disabled={loading}
onClick={() => localStorage.setItem(MODAL_DISMISSED_KEY, "true")}
>
{loading ? "Loading ..." : "Update"}
</button>
</form>
<button
className="btn btn-sm primary mt-8"
type="submit"
disabled={loading}
>
{loading ? "Loading ..." : "Update"}
</button>
</form>
);
}

0 comments on commit 5020f8c

Please sign in to comment.