Skip to content

Commit

Permalink
Added missing feature flag for setting autofill policy on load (#10467)
Browse files Browse the repository at this point in the history
* Added missing feature flag

* Fixed comment

* reverted change

* moved feature flag check higher up
  • Loading branch information
gbubemismith authored Aug 9, 2024
1 parent d1c3ec4 commit a64a676
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions apps/browser/src/background/runtime.background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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":
Expand All @@ -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":
Expand Down

0 comments on commit a64a676

Please sign in to comment.