chore: fix form event in firefox

This commit is contained in:
Steven 2023-07-23 02:09:50 +08:00
parent 11205566ac
commit 86078b097d
2 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,5 @@
import { Button, Input } from "@mui/joy";
import React, { useEffect, useState } from "react";
import React, { FormEvent, useEffect, useState } from "react";
import { Link, useNavigate } from "react-router-dom";
import { toast } from "react-hot-toast";
import * as api from "../helpers/api";
@ -44,7 +44,8 @@ const SignIn: React.FC = () => {
setPassword(text);
};
const handleSigninBtnClick = async () => {
const handleSigninBtnClick = async (e: FormEvent) => {
e.preventDefault();
if (actionBtnLoadingState.isLoading) {
return;
}

View File

@ -1,5 +1,5 @@
import { Button, Input } from "@mui/joy";
import React, { useEffect, useState } from "react";
import React, { FormEvent, useEffect, useState } from "react";
import { Link, useNavigate } from "react-router-dom";
import { toast } from "react-hot-toast";
import * as api from "../helpers/api";
@ -48,7 +48,8 @@ const SignUp: React.FC = () => {
setPassword(text);
};
const handleSignupBtnClick = async () => {
const handleSignupBtnClick = async (e: FormEvent) => {
e.preventDefault();
if (actionBtnLoadingState.isLoading) {
return;
}