1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-12 14:34:02 +00:00

Revert "Expose userEnvironment$ Method"

This reverts commit dadd337a6b.
This commit is contained in:
Justin Baur
2024-11-12 13:55:23 -05:00
parent 695741769b
commit ce365cd47b
2 changed files with 0 additions and 24 deletions

View File

@@ -92,23 +92,9 @@ export interface Environment {
* The environment service. Provides access to set the current environment urls and region.
*/
export abstract class EnvironmentService {
/**
* An observable that follows the environment of the active user if there is one or falls
* back to the environment saved in global state.
*/
abstract environment$: Observable<Environment>;
/**
* An observable that follows the cloud web vault url for the active user if there is one
* or falls back to the cloud web vault url saved in global state.
*/
abstract cloudWebVaultUrl$: Observable<string>;
/**
* Gets an observable stream of the configured Environment for a given user.
* @param userId The id of the user to get the environment for.
*/
abstract userEnvironment$(userId: UserId): Observable<Environment>;
/**
* Retrieve all the available regions for environment selectors.
*
@@ -141,8 +127,6 @@ export abstract class EnvironmentService {
/**
* Get the environment from state. Useful if you need to get the environment for another user.
*
* @deprecated Use {@link userEnvironment$} with a {@link UserId} to get the environment for a given user.
*/
abstract getEnvironment(userId?: string): Promise<Environment | undefined>;
}

View File

@@ -181,14 +181,6 @@ export class DefaultEnvironmentService implements EnvironmentService {
return PRODUCTION_REGIONS.concat(this.additionalRegionConfigs);
}
userEnvironment$(userId: UserId): Observable<Environment> {
return this.stateProvider
.getUser(userId, USER_ENVIRONMENT_KEY)
.state$.pipe(
map((environment) => this.buildEnvironment(environment?.region, environment?.urls)),
);
}
/**
* Get the region configuration for the given region.
*/