File tree 1 file changed +12
-6
lines changed
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -813,6 +813,16 @@ class Account extends Component {
813
813
this . getUserSetting ( 'user_login' ) === this . state . userLoginConfirm &&
814
814
this . state . userLoginConfirm . length > 0 ;
815
815
816
+ const usernameValidationFailureMessage = this . getUsernameValidationFailureMessage ( ) ;
817
+ const isError = ! usernameMatch || usernameValidationFailureMessage ;
818
+
819
+ let validationMessage = translate ( 'Please re-enter your new username to confirm it.' ) ;
820
+ if ( usernameMatch ) {
821
+ validationMessage = usernameValidationFailureMessage
822
+ ? usernameValidationFailureMessage
823
+ : translate ( 'Thanks for confirming your new username!' ) ;
824
+ }
825
+
816
826
return (
817
827
< div className = "account__username-form" key = "usernameForm" >
818
828
< FormFieldset >
@@ -827,13 +837,9 @@ class Account extends Component {
827
837
value = { this . state . userLoginConfirm ?? '' }
828
838
onChange = { this . updateUserLoginConfirm }
829
839
isValid = { usernameMatch }
830
- isError = { ! usernameMatch }
840
+ isError = { isError }
831
841
/>
832
- < FormInputValidation isError = { ! usernameMatch } >
833
- { usernameMatch
834
- ? translate ( 'Thanks for confirming your new username!' )
835
- : translate ( 'Please re-enter your new username to confirm it.' ) }
836
- </ FormInputValidation >
842
+ < FormInputValidation isError = { isError } > { validationMessage } </ FormInputValidation >
837
843
</ FormFieldset >
838
844
839
845
{ this . renderBlogActionFields ( ) }
You can’t perform that action at this time.
0 commit comments