diff --git a/src/services/autofill.service.ts b/src/services/autofill.service.ts index 10fe31f953..1f27c782c1 100644 --- a/src/services/autofill.service.ts +++ b/src/services/autofill.service.ts @@ -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], diff --git a/src/services/autofillConstants.ts b/src/services/autofillConstants.ts index 811654cb5b..989ab02597 100644 --- a/src/services/autofillConstants.ts +++ b/src/services/autofillConstants.ts @@ -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",