From 406ccbf7c3b48e1a3fe8bb78ee61a2167c5479e7 Mon Sep 17 00:00:00 2001 From: Cesar Gonzalez Date: Tue, 24 Sep 2024 09:48:59 -0500 Subject: [PATCH] [PM-12316] Fixing an edge case issue where updating the overlay ciphers can trigger an update of the passkey auth view before the page is refreshed --- .../pages/list/autofill-inline-menu-list.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts b/apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts index d7cf97d9c2..27a9c68d99 100644 --- a/apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts +++ b/apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts @@ -41,6 +41,7 @@ export class AutofillInlineMenuList extends AutofillInlineMenuPageElement { private passkeysHeadingHeight: number; private lastPasskeysListItemHeight: number; private ciphersListHeight: number; + private isPasskeyAuthInProgress = false; private readonly showCiphersPerPage = 6; private readonly headingBorderClass = "inline-menu-list-heading--bordered"; private readonly inlineMenuListWindowMessageHandlers: AutofillInlineMenuListWindowMessageHandlers = @@ -157,6 +158,10 @@ export class AutofillInlineMenuList extends AutofillInlineMenuPageElement { ciphers: InlineMenuCipherData[], showInlineMenuAccountCreation?: boolean, ) { + if (this.isPasskeyAuthInProgress) { + return; + } + this.ciphers = ciphers; this.currentCipherIndex = 0; this.showInlineMenuAccountCreation = showInlineMenuAccountCreation; @@ -929,6 +934,7 @@ export class AutofillInlineMenuList extends AutofillInlineMenuPageElement { * Creates an indicator for the user that the passkey is being authenticated. */ private createPasskeyAuthenticatingLoader() { + this.isPasskeyAuthInProgress = true; this.resetInlineMenuContainer(); const passkeyAuthenticatingLoader = globalThis.document.createElement("div"); @@ -937,6 +943,11 @@ export class AutofillInlineMenuList extends AutofillInlineMenuPageElement { passkeyAuthenticatingLoader.appendChild(buildSvgDomElement(spinnerIcon)); this.inlineMenuListContainer.appendChild(passkeyAuthenticatingLoader); + + globalThis.setTimeout(() => { + this.isPasskeyAuthInProgress = false; + this.postMessageToParent({ command: "checkAutofillInlineMenuButtonFocused" }); + }, 4000); } /**