sync working code, and import type-doc

This commit is contained in:
2023-07-17 17:24:49 +08:00
parent 7ab7a7094a
commit 3e9ee59178
43 changed files with 1024 additions and 1553 deletions

View File

@ -155,11 +155,14 @@ class Contact {
.then(() => this.#refs.contactName.focus());
return null;
}
if (nullOrEmpty(email) && nullOrEmpty(phone)) {
showAlert(title, r('contactEmailPhoneRequired', 'Email and Mobile Phone cannot both be empty.'), 'warn')
.then(() => nullOrEmpty(email) ?
this.#refs.contactEmail.focus() :
this.#refs.contactMobile.focus());
if ((pref == 0 || pref == 2) && nullOrEmpty(phone)) {
showAlert(title, r('contactPhoneRequired', 'Mobile cannot be empty.'), 'warn')
.then(() => this.#refs.contactMobile.focus());
return null;
}
if (pref == 1 && nullOrEmpty(email)) {
showAlert(title, r('contactEmailRequired', 'Email cannot be empty.'), 'warn')
.then(() => this.#refs.contactEmail.focus());
return null;
}
if (!nullOrEmpty(email) && !isEmail(email)) {
@ -176,6 +179,8 @@ class Contact {
contact.selected = !opt;
}
}
contact.OldName = contact.Name;
contact.OldMobilePhone = contact.MobilePhone;
contact.Name = name;
contact.ContactPreference = pref;
contact.Email = email;