From c1302a3604e0c8de91600251818a4f5ca21643f2 Mon Sep 17 00:00:00 2001 From: Evan Bassler Date: Thu, 14 Nov 2024 12:29:30 -0600 Subject: [PATCH] reorder address field identification (#11824) Co-authored-by: Evan Bassler Co-authored-by: Matt Bishop --- .../src/autofill/services/autofill.service.ts | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/apps/browser/src/autofill/services/autofill.service.ts b/apps/browser/src/autofill/services/autofill.service.ts index e79f6f69a36..24054794b62 100644 --- a/apps/browser/src/autofill/services/autofill.service.ts +++ b/apps/browser/src/autofill/services/autofill.service.ts @@ -1597,16 +1597,6 @@ export default class AutofillService implements AutofillServiceInterface { ) { fillFields.email = f; break; - } else if ( - !fillFields.address && - AutofillService.isFieldMatch( - f[attr], - IdentityAutoFillConstants.AddressFieldNames, - IdentityAutoFillConstants.AddressFieldNameValues, - ) - ) { - fillFields.address = f; - break; } else if ( !fillFields.address1 && AutofillService.isFieldMatch(f[attr], IdentityAutoFillConstants.Address1FieldNames) @@ -1625,6 +1615,16 @@ export default class AutofillService implements AutofillServiceInterface { ) { fillFields.address3 = f; break; + } else if ( + !fillFields.address && + AutofillService.isFieldMatch( + f[attr], + IdentityAutoFillConstants.AddressFieldNames, + IdentityAutoFillConstants.AddressFieldNameValues, + ) + ) { + fillFields.address = f; + break; } else if ( !fillFields.postalCode && AutofillService.isFieldMatch(f[attr], IdentityAutoFillConstants.PostalCodeFieldNames) @@ -1818,11 +1818,6 @@ export default class AutofillService implements AutofillServiceInterface { continue; } - if (this.shouldMakeIdentityAddressFillScript(filledFields, keywordsList)) { - this.makeIdentityAddressFillScript(fillScript, filledFields, field, identity); - continue; - } - if (this.shouldMakeIdentityAddress1FillScript(filledFields, keywordsCombined)) { this.makeScriptActionWithValue(fillScript, identity.address1, field, filledFields); continue; @@ -1838,6 +1833,11 @@ export default class AutofillService implements AutofillServiceInterface { continue; } + if (this.shouldMakeIdentityAddressFillScript(filledFields, keywordsList)) { + this.makeIdentityAddressFillScript(fillScript, filledFields, field, identity); + continue; + } + if (this.shouldMakeIdentityPostalCodeFillScript(filledFields, keywordsCombined)) { this.makeScriptActionWithValue(fillScript, identity.postalCode, field, filledFields); continue;