Move city fieldnames to Identity constants

This commit is contained in:
Daniel James Smith 2022-01-02 14:50:26 +01:00
parent 6304964ad4
commit 61dbe5421f
No known key found for this signature in database
GPG Key ID: 03E4BD365FF06726
2 changed files with 9 additions and 1 deletions

View File

@ -647,7 +647,7 @@ export default class AutofillService implements AutofillServiceInterface {
fillFields.postalCode = f;
break;
} else if (!fillFields.city && this.isFieldMatch(f[attr],
['city', 'town', 'address-level-2', 'address-city', 'address-town'])) {
IdentityAutoFillConstants.CityFieldNames)) {
fillFields.city = f;
break;
} else if (!fillFields.state && this.isFieldMatch(f[attr],

View File

@ -262,6 +262,14 @@ export class IdentityAutoFillConstants {
"address-zip-code",
];
static readonly CityFieldNames: string[] = [
"city",
"town",
"address-level-2",
"address-city",
"address-town",
];
static readonly IsoCountries: { [id: string]: string } = {
afghanistan: "AF",
"aland islands": "AX",