mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
PM-10076 - Registration start - hide env selector when on web and self hosted like other env selectors. (#10255)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
<form [formGroup]="formGroup">
|
<form [formGroup]="formGroup" *ngIf="!hideEnvSelector">
|
||||||
<bit-form-field>
|
<bit-form-field>
|
||||||
<bit-label>{{ "creatingAccountOn" | i18n }}</bit-label>
|
<bit-label>{{ "creatingAccountOn" | i18n }}</bit-label>
|
||||||
<bit-select formControlName="selectedRegion">
|
<bit-select formControlName="selectedRegion">
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ export class RegistrationEnvSelectorComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
private selectedRegionFromEnv: RegionConfig | Region.SelfHosted;
|
private selectedRegionFromEnv: RegionConfig | Region.SelfHosted;
|
||||||
|
|
||||||
|
hideEnvSelector = false;
|
||||||
isDesktopOrBrowserExtension = false;
|
isDesktopOrBrowserExtension = false;
|
||||||
|
|
||||||
private destroy$ = new Subject<void>();
|
private destroy$ = new Subject<void>();
|
||||||
@@ -59,9 +60,15 @@ export class RegistrationEnvSelectorComponent implements OnInit, OnDestroy {
|
|||||||
const clientType = platformUtilsService.getClientType();
|
const clientType = platformUtilsService.getClientType();
|
||||||
this.isDesktopOrBrowserExtension =
|
this.isDesktopOrBrowserExtension =
|
||||||
clientType === ClientType.Desktop || clientType === ClientType.Browser;
|
clientType === ClientType.Desktop || clientType === ClientType.Browser;
|
||||||
|
|
||||||
|
this.hideEnvSelector = clientType === ClientType.Web && this.platformUtilsService.isSelfHost();
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
if (this.hideEnvSelector) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await this.initSelectedRegionAndListenForEnvChanges();
|
await this.initSelectedRegionAndListenForEnvChanges();
|
||||||
this.listenForSelectedRegionChanges();
|
this.listenForSelectedRegionChanges();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user