Move phone fieldnames to Identity constants

This commit is contained in:
Daniel James Smith 2022-01-02 14:54:31 +01:00
parent 423ef40aa1
commit aeeb44e8c9
No known key found for this signature in database
GPG Key ID: 03E4BD365FF06726
2 changed files with 10 additions and 1 deletions

View File

@ -659,7 +659,7 @@ export default class AutofillService implements AutofillServiceInterface {
fillFields.country = f;
break;
} else if (!fillFields.phone && this.isFieldMatch(f[attr],
['phone', 'mobile', 'mobile-phone', 'tel', 'telephone', 'phone-number'])) {
IdentityAutoFillConstants.PhoneFieldNames)) {
fillFields.phone = f;
break;
} else if (!fillFields.username && this.isFieldMatch(f[attr],

View File

@ -288,6 +288,15 @@ export class IdentityAutoFillConstants {
"address-country-code",
];
static readonly PhoneFieldNames: string[] = [
"phone",
"mobile",
"mobile-phone",
"tel",
"telephone",
"phone-number",
];
static readonly IsoCountries: { [id: string]: string } = {
afghanistan: "AF",
"aland islands": "AX",