diff --git a/apps/browser/src/autofill/background/overlay.background.spec.ts b/apps/browser/src/autofill/background/overlay.background.spec.ts index 50fb291b121..66b324e4da4 100644 --- a/apps/browser/src/autofill/background/overlay.background.spec.ts +++ b/apps/browser/src/autofill/background/overlay.background.spec.ts @@ -3604,12 +3604,14 @@ describe("OverlayBackground", () => { }); it("sends a message to the list port indicating that the generated password should be updated", async () => { + overlayBackground["generatedPassword"] = "refresh"; + sendPortMessage(listMessageConnectorSpy, { command: "refreshGeneratedPassword", portKey }); await flushPromises(); expect(listPortSpy.postMessage).toHaveBeenCalledWith({ command: "updateAutofillInlineMenuGeneratedPassword", - generatedPassword, + generatedPassword: "refresh", refreshPassword: true, }); }); diff --git a/apps/browser/src/autofill/background/overlay.background.ts b/apps/browser/src/autofill/background/overlay.background.ts index 7feaf793fa2..6b95cd2b300 100644 --- a/apps/browser/src/autofill/background/overlay.background.ts +++ b/apps/browser/src/autofill/background/overlay.background.ts @@ -1813,7 +1813,7 @@ export class OverlayBackground implements OverlayBackgroundInterface { /** * Generates a password based on the user defined password generation options. */ - private async requestGeneratedPassword(source: GenerateRequest["source"]) { + private requestGeneratedPassword(source: GenerateRequest["source"]) { this.requestGeneratedPassword$.next({ source, type: Type.password }); } @@ -1824,7 +1824,7 @@ export class OverlayBackground implements OverlayBackgroundInterface { */ private async updateGeneratedPassword(refreshPassword: boolean = false) { if (!this.generatedPassword || refreshPassword) { - await this.requestGeneratedPassword("inline-menu"); + this.requestGeneratedPassword("inline-menu"); } this.postMessageToPort(this.inlineMenuListPort, { @@ -3089,7 +3089,7 @@ export class OverlayBackground implements OverlayBackgroundInterface { } if (!this.generatedPassword) { - await this.requestGeneratedPassword(); + this.requestGeneratedPassword("inline-menu"); } return true;