From e9f9eea80cc0b1cf6d28e0029c7dff16b8124eb6 Mon Sep 17 00:00:00 2001 From: JimmFly <447268514@qq.com> Date: Mon, 26 Feb 2024 08:32:48 +0000 Subject: [PATCH] fix(core): handling error message when sending verify change email (#5894) --- packages/frontend/core/src/pages/auth.tsx | 7 +++++++ packages/frontend/i18n/src/resources/en.json | 1 + 2 files changed, 8 insertions(+) diff --git a/packages/frontend/core/src/pages/auth.tsx b/packages/frontend/core/src/pages/auth.tsx index d44e5339ba..c32fe72536 100644 --- a/packages/frontend/core/src/pages/auth.tsx +++ b/packages/frontend/core/src/pages/auth.tsx @@ -78,6 +78,13 @@ export const AuthPage = (): ReactElement | null => { }); } + if (!res?.sendVerifyChangeEmail) { + pushNotification({ + title: t['com.affine.auth.sent.change.email.fail'](), + type: 'error', + }); + } + return !!res?.sendVerifyChangeEmail; }, [pushNotification, searchParams, sendVerifyChangeEmail, t] diff --git a/packages/frontend/i18n/src/resources/en.json b/packages/frontend/i18n/src/resources/en.json index 140bdcec07..3ef4402a2b 100644 --- a/packages/frontend/i18n/src/resources/en.json +++ b/packages/frontend/i18n/src/resources/en.json @@ -435,6 +435,7 @@ "com.affine.auth.send.set.password.link": "Send set link", "com.affine.auth.sent": "Sent", "com.affine.auth.sent.change.email.hint": "Verification link has been sent.", + "com.affine.auth.sent.change.email.fail": "The verification link failed to be sent, please try again later.", "com.affine.auth.sent.change.password.hint": "Reset password link has been sent.", "com.affine.auth.sent.reset.password.success.message": "Your password has upgraded! You can sign in AFFiNE Cloud with new password!", "com.affine.auth.sent.set.password.hint": "Set password link has been sent.",