From a64a676ebd225d3d4f0e2102185aef026357c42c Mon Sep 17 00:00:00 2001 From: SmithThe4th Date: Fri, 9 Aug 2024 13:22:13 -0400 Subject: [PATCH] Added missing feature flag for setting autofill policy on load (#10467) * Added missing feature flag * Fixed comment * reverted change * moved feature flag check higher up --- apps/browser/src/background/runtime.background.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/browser/src/background/runtime.background.ts b/apps/browser/src/background/runtime.background.ts index 660f85617c..33a18fbad2 100644 --- a/apps/browser/src/background/runtime.background.ts +++ b/apps/browser/src/background/runtime.background.ts @@ -33,6 +33,7 @@ export default class RuntimeBackground { private pageDetailsToAutoFill: any[] = []; private onInstalledReason: string = null; private lockedVaultPendingNotifications: LockedVaultPendingNotificationsData[] = []; + private extensionRefreshIsActive: boolean = false; constructor( private main: MainBackground, @@ -89,6 +90,10 @@ export default class RuntimeBackground { return false; }; + this.extensionRefreshIsActive = await this.configService.getFeatureFlag( + FeatureFlag.ExtensionRefresh, + ); + this.messageListener.allMessages$ .pipe( mergeMap(async (message: any) => { @@ -228,7 +233,10 @@ export default class RuntimeBackground { // `getAllDecryptedForUrl` and is anticipated to be refactored await this.main.refreshBadge(); await this.main.refreshMenu(false); - await this.autofillService.setAutoFillOnPageLoadOrgPolicy(); + + if (this.extensionRefreshIsActive) { + await this.autofillService.setAutoFillOnPageLoadOrgPolicy(); + } break; } case "addToLockedVaultPendingNotifications": @@ -248,7 +256,10 @@ export default class RuntimeBackground { }, 2000); await this.configService.ensureConfigFetched(); await this.main.updateOverlayCiphers(); - await this.autofillService.setAutoFillOnPageLoadOrgPolicy(); + + if (this.extensionRefreshIsActive) { + await this.autofillService.setAutoFillOnPageLoadOrgPolicy(); + } } break; case "openPopup":