1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

[PM-3020] Change initialization of EnvironmentService to default to uninitialized (#5830)

* Set initialized to false on construction of the EnvironmentService

* Add initialization on browser and desktop.

* Added comments.
This commit is contained in:
Todd Martin
2023-07-14 15:10:47 -04:00
committed by GitHub
parent 79ed4ff83f
commit b2374acc7f
4 changed files with 10 additions and 4 deletions

View File

@@ -12,7 +12,7 @@ export class EnvironmentService implements EnvironmentServiceAbstraction {
private readonly urlsSubject = new Subject<void>();
urls: Observable<void> = this.urlsSubject.asObservable();
selectedRegion?: Region;
initialized = true;
initialized = false;
protected baseUrl: string;
protected webVaultUrl: string;
@@ -286,6 +286,7 @@ export class EnvironmentService implements EnvironmentServiceAbstraction {
async setRegion(region: Region) {
this.selectedRegion = region;
await this.stateService.setRegion(region);
if (region === Region.SelfHosted) {
// If user saves a self-hosted region with empty fields, default to US
if (this.isEmpty()) {