From b82b9d332f1211efba2ab4f8dcddafb4ede7e70e Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Sun, 15 Oct 2023 11:56:39 +0800 Subject: [PATCH] Prevent registers/logins multiple times when spamming buttons --- src/routes/Login/Login.tsx | 78 +++++++++++++++++--------------- src/routes/Register/Register.tsx | 2 +- 2 files changed, 42 insertions(+), 38 deletions(-) diff --git a/src/routes/Login/Login.tsx b/src/routes/Login/Login.tsx index b33ef2c..9aa4422 100644 --- a/src/routes/Login/Login.tsx +++ b/src/routes/Login/Login.tsx @@ -27,6 +27,7 @@ import { RootState } from "../../features/redux/Store/Store"; export default function Login() { const navigation = useNavigation(); const status = useSelector((state: RootState) => state.status); + const [logging_in, setLoggingIn] = useState(false); const dispatch = useDispatch(); const [creds, setCreds] = useState({ username: "", @@ -76,49 +77,52 @@ export default function Login() {