Move country fieldnames to Identity constants

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

View File

@ -655,8 +655,7 @@ export default class AutofillService implements AutofillServiceInterface {
fillFields.state = f;
break;
} else if (!fillFields.country && this.isFieldMatch(f[attr],
['country', 'country-code', 'country-name', 'address-country', 'address-country-name',
'address-country-code'])) {
IdentityAutoFillConstants.CountryFieldNames)) {
fillFields.country = f;
break;
} else if (!fillFields.phone && this.isFieldMatch(f[attr],

View File

@ -279,6 +279,15 @@ export class IdentityAutoFillConstants {
"address-province",
];
static readonly CountryFieldNames: string[] = [
"country",
"country-code",
"country-name",
"address-country",
"address-country-name",
"address-country-code",
];
static readonly IsoCountries: { [id: string]: string } = {
afghanistan: "AF",
"aland islands": "AX",