mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 00:03:56 +00:00
[AC-1479][BEEEP] Refactor ConfigService to improve observable usage (#5602)
* refactor ConfigService to use observables * make environmentService.urls a ReplaySubject --------- Co-authored-by: Hinton <hinton@users.noreply.github.com>
This commit is contained in:
@@ -89,7 +89,7 @@ export class EnvironmentSelectorComponent implements OnInit, OnDestroy {
|
||||
|
||||
async updateEnvironmentInfo() {
|
||||
this.selectedEnvironment = this.environmentService.selectedRegion;
|
||||
this.euServerFlagEnabled = await this.configService.getFeatureFlagBool(
|
||||
this.euServerFlagEnabled = await this.configService.getFeatureFlag<boolean>(
|
||||
FeatureFlag.DisplayEuEnvironmentFlag
|
||||
);
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ describe("SsoComponent", () => {
|
||||
|
||||
describe("Trusted Device Encryption scenarios", () => {
|
||||
beforeEach(() => {
|
||||
mockConfigService.getFeatureFlagBool.mockResolvedValue(true); // TDE enabled
|
||||
mockConfigService.getFeatureFlag.mockResolvedValue(true); // TDE enabled
|
||||
});
|
||||
|
||||
describe("Given Trusted Device Encryption is enabled and user needs to set a master password", () => {
|
||||
|
||||
@@ -242,7 +242,7 @@ export class SsoComponent {
|
||||
private async isTrustedDeviceEncEnabled(
|
||||
trustedDeviceOption: TrustedDeviceUserDecryptionOption
|
||||
): Promise<boolean> {
|
||||
const trustedDeviceEncryptionFeatureActive = await this.configService.getFeatureFlagBool(
|
||||
const trustedDeviceEncryptionFeatureActive = await this.configService.getFeatureFlag<boolean>(
|
||||
FeatureFlag.TrustedDeviceEncryption
|
||||
);
|
||||
|
||||
|
||||
@@ -376,7 +376,7 @@ describe("TwoFactorComponent", () => {
|
||||
|
||||
describe("Trusted Device Encryption scenarios", () => {
|
||||
beforeEach(() => {
|
||||
mockConfigService.getFeatureFlagBool.mockResolvedValue(true);
|
||||
mockConfigService.getFeatureFlag.mockResolvedValue(true);
|
||||
});
|
||||
|
||||
describe("Given Trusted Device Encryption is enabled and user needs to set a master password", () => {
|
||||
|
||||
@@ -257,7 +257,7 @@ export class TwoFactorComponent extends CaptchaProtectedComponent implements OnI
|
||||
trustedDeviceOption: TrustedDeviceUserDecryptionOption
|
||||
): Promise<boolean> {
|
||||
const ssoTo2faFlowActive = this.route.snapshot.queryParamMap.get("sso") === "true";
|
||||
const trustedDeviceEncryptionFeatureActive = await this.configService.getFeatureFlagBool(
|
||||
const trustedDeviceEncryptionFeatureActive = await this.configService.getFeatureFlag<boolean>(
|
||||
FeatureFlag.TrustedDeviceEncryption
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user