fix: fast zap not working

This commit is contained in:
Kieran 2023-10-18 13:15:33 +01:00
parent c565dbc993
commit d954b90bfd
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -4,7 +4,7 @@ export default function useLoading<T>(fn: ((e: React.MouseEvent) => Promise<T> |
const [loading, setLoading] = useState<boolean>(false);
async function handle(e: React.MouseEvent) {
e.stopPropagation();
e.preventDefault();
if (loading || disabled) return;
setLoading(true);
try {