From f789e366f272354b80cafbadbd3ba0fb14c55ef8 Mon Sep 17 00:00:00 2001 From: Qi <474021214@qq.com> Date: Thu, 7 Sep 2023 13:02:33 +0800 Subject: [PATCH] fix: wrong text in change password page (#4244) Co-authored-by: Alex Yang --- .../src/components/auth-components/change-password-page.tsx | 4 ++-- .../src/components/auth-components/password-input/index.tsx | 3 +++ .../src/components/auth-components/set-password-page.tsx | 6 +++--- packages/i18n/src/resources/en.json | 4 ++++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/component/src/components/auth-components/change-password-page.tsx b/packages/component/src/components/auth-components/change-password-page.tsx index 4b0b62a554..01680417d8 100644 --- a/packages/component/src/components/auth-components/change-password-page.tsx +++ b/packages/component/src/components/auth-components/change-password-page.tsx @@ -32,12 +32,12 @@ export const ChangePasswordPage: FC<{ {t['com.affine.auth.page.sent.email.subtitle']()} diff --git a/packages/component/src/components/auth-components/password-input/index.tsx b/packages/component/src/components/auth-components/password-input/index.tsx index 048e0f497c..5d2f612061 100644 --- a/packages/component/src/components/auth-components/password-input/index.tsx +++ b/packages/component/src/components/auth-components/password-input/index.tsx @@ -53,6 +53,9 @@ export const PasswordInput: FC< }, []); useEffect(() => { + if (!password || !confirmPassword) { + return; + } if (password === confirmPassword) { setConfirmStatus('success'); } else { diff --git a/packages/component/src/components/auth-components/set-password-page.tsx b/packages/component/src/components/auth-components/set-password-page.tsx index 4caf97c8cb..cf126f8837 100644 --- a/packages/component/src/components/auth-components/set-password-page.tsx +++ b/packages/component/src/components/auth-components/set-password-page.tsx @@ -33,12 +33,12 @@ export const SetPasswordPage: FC<{ {t['com.affine.auth.page.sent.email.subtitle']()} diff --git a/packages/i18n/src/resources/en.json b/packages/i18n/src/resources/en.json index 1748eb08b6..4986c4849b 100644 --- a/packages/i18n/src/resources/en.json +++ b/packages/i18n/src/resources/en.json @@ -92,11 +92,15 @@ "com.affine.auth.sent.change.email.hint": "Verification link has been sent.", "com.affine.auth.sent.change.password.hint": "Reset password link has been sent.", "com.affine.auth.sent.set.password.hint": "Set password link has been sent.", + "com.affine.auth.set.email.save": "Save Email", "com.affine.auth.set.password": "Set password", "com.affine.auth.set.password.message": "Please set a password of 8-20 characters with both letters and numbers to continue signing up with ", "com.affine.auth.change.email.message": "Your current email is {{email}}. We’ll send a temporary verification link to this email.", "com.affine.auth.set.password.page.success": "Password set successful", + "com.affine.auth.reset.password.page.success": "Password reset successful", + "com.affine.auth.sent.set.password.success.message": "Your password has saved! You can sign in AFFiNE Cloud with email and password!", + "com.affine.auth.sent.reset.password.success.message": "Your password has upgraded! You can sign in AFFiNE Cloud with new password!", "com.affine.auth.set.password.page.title": "Set your AFFiNE Cloud password", "com.affine.auth.set.password.placeholder": "Set a password at least 8 letters long", "com.affine.auth.set.password.placeholder.confirm": "Confirm password",