fix(ForgotPasswordPage): handle loading state correctly during password reset

This commit is contained in:
Zeke Zhang 2025-04-18 09:34:20 +08:00
parent 728b28632b
commit e79f111cf9

View File

@ -46,9 +46,12 @@ const getForgotPasswordForm = (): ISchema => ({
async run() {
await form.submit();
setLoading(true);
try {
await api.auth.lostPassword(form.values);
message.success(t("Reset email sent successfully"));
} finally {
setLoading(false);
}
message.success(t("Reset email sent successfully"));
form.reset();
},
loading,