save
This commit is contained in:
@@ -197,7 +197,7 @@ export default defineComponent({
|
||||
return modalStore.whichModal === MODAL_CREATE_NEW ? i18next.t('AcctMgmt.CreateNew') : i18next.t('AcctMgmt.AccountEdit');
|
||||
});
|
||||
|
||||
const validateInputLengthAndEquality = (inputAccountToTest, inputNameToTest, inputPasswordToTest, inputConfirmPwdToTest, inputPwdMatchedToTest,
|
||||
const shouldDisalbeConfirmButton = (inputAccountToTest, inputNameToTest, inputPasswordToTest, inputConfirmPwdToTest, inputPwdMatchedToTest,
|
||||
) => {
|
||||
return !inputAccountToTest?.length || !inputNameToTest?.length || !inputPasswordToTest?.length
|
||||
|| !inputConfirmPwdToTest?.length || !inputPwdMatchedToTest;
|
||||
@@ -291,7 +291,7 @@ export default defineComponent({
|
||||
watch(
|
||||
[inputUserAccount, inputName, inputPwd, inputConfirmPwd, isPwdMatched],
|
||||
([newAccount, newName, newPwd, newConfirmPwd, newPwdMatched]) => {
|
||||
if (validateInputLengthAndEquality(newAccount, newName, newPwd, newConfirmPwd, newPwdMatched)) {
|
||||
if (shouldDisalbeConfirmButton(newAccount, newName, newPwd, newConfirmPwd, newPwdMatched)) {
|
||||
isConfirmDisabled.value = true;
|
||||
} else {
|
||||
isConfirmDisabled.value = false;
|
||||
@@ -299,6 +299,13 @@ export default defineComponent({
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
watch(
|
||||
[inputPwd, inputConfirmPwd],
|
||||
([newPwd, newConfirmPwd]) => {
|
||||
isPwdMatched.value = newPwd === newConfirmPwd && newPwd.length;
|
||||
}
|
||||
)
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user