From e79f111cf97fc0f1a01078991e3349b917d50ec4 Mon Sep 17 00:00:00 2001 From: Zeke Zhang <958414905@qq.com> Date: Fri, 18 Apr 2025 09:34:20 +0800 Subject: [PATCH] fix(ForgotPasswordPage): handle loading state correctly during password reset --- .../plugin-auth/src/client/pages/ForgotPasswordPage.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/plugins/@nocobase/plugin-auth/src/client/pages/ForgotPasswordPage.tsx b/packages/plugins/@nocobase/plugin-auth/src/client/pages/ForgotPasswordPage.tsx index da07fe0bad..e9f7d384b4 100644 --- a/packages/plugins/@nocobase/plugin-auth/src/client/pages/ForgotPasswordPage.tsx +++ b/packages/plugins/@nocobase/plugin-auth/src/client/pages/ForgotPasswordPage.tsx @@ -46,9 +46,12 @@ const getForgotPasswordForm = (): ISchema => ({ async run() { await form.submit(); setLoading(true); - await api.auth.lostPassword(form.values); + try { + await api.auth.lostPassword(form.values); + } finally { + setLoading(false); + } message.success(t("Reset email sent successfully")); - setLoading(false); form.reset(); }, loading,