From 0ed5d400b7acba47f191056cf74337382e53ad6e Mon Sep 17 00:00:00 2001 From: NotNite Date: Wed, 26 Apr 2023 15:19:22 -0400 Subject: [PATCH] only lock register button before api call --- src/app/layout.tsx | 1 + src/app/register/RegisterForm.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 810fa3d..e728ffa 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -19,6 +19,7 @@ export default function RootLayout({ + diff --git a/src/app/register/RegisterForm.tsx b/src/app/register/RegisterForm.tsx index ea2d3cf..6da3ad1 100644 --- a/src/app/register/RegisterForm.tsx +++ b/src/app/register/RegisterForm.tsx @@ -64,7 +64,6 @@ export default function RegisterForm() {
{ e.preventDefault(); - submitRef.current!.disabled = true; const [username, displayName, email, password, confirmPassword] = [ usernameRef, @@ -88,6 +87,7 @@ export default function RegisterForm() { return; } + submitRef.current!.disabled = true; const req = await fetch(`/api/register`, { method: "POST", headers: {