mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
[PM-19287] Feature flag for encrypt service (#13894)
* Extract getFeatureFlagValue to pure function Co-authored-by: Matt Gibson <mgibson@bitwarden.com> * Add broadcasting abstractions and OnServerConfigChange interface. Co-authored-by: Matt Gibson <mgibson@bitwarden.com> * Add implementation of onServerConfigChange on encrypt services Co-authored-by: Matt Gibson <mgibson@bitwarden.com> * Add onServerConfigChange implementation for encrypt worker Co-authored-by: Matt Gibson <mgibson@bitwarden.com> * Wire up broadcasting in dependency injection Co-authored-by: Matt Gibson <mgibson@bitwarden.com> * Add unit tests * Handle subscribing for onServerConfigChange in init services --------- Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
This commit is contained in:
@@ -1309,6 +1309,13 @@ export default class MainBackground {
|
||||
// Only the "true" background should run migrations
|
||||
await this.stateService.init({ runMigrations: true });
|
||||
|
||||
this.configService.serverConfig$.subscribe((newConfig) => {
|
||||
if (newConfig != null) {
|
||||
this.encryptService.onServerConfigChange(newConfig);
|
||||
this.bulkEncryptService.onServerConfigChange(newConfig);
|
||||
}
|
||||
});
|
||||
|
||||
// This is here instead of in in the InitService b/c we don't plan for
|
||||
// side effects to run in the Browser InitService.
|
||||
const accounts = await firstValueFrom(this.accountService.accounts$);
|
||||
|
||||
Reference in New Issue
Block a user