mirror of
https://github.com/bitwarden/browser.git
synced 2024-10-17 07:15:13 +02:00
Initialize RegistrationSelfHostedEnvConfigDialog with existing values if self hosted
This commit is contained in:
parent
c13bded29b
commit
d4437ea7dd
@ -10,7 +10,7 @@ import {
|
|||||||
ValidationErrors,
|
ValidationErrors,
|
||||||
ValidatorFn,
|
ValidatorFn,
|
||||||
} from "@angular/forms";
|
} from "@angular/forms";
|
||||||
import { Subject, firstValueFrom } from "rxjs";
|
import { Subject, firstValueFrom, take, filter, takeUntil } from "rxjs";
|
||||||
|
|
||||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||||
import {
|
import {
|
||||||
@ -131,7 +131,24 @@ export class RegistrationSelfHostedEnvConfigDialogComponent implements OnInit, O
|
|||||||
private environmentService: EnvironmentService,
|
private environmentService: EnvironmentService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {}
|
ngOnInit() {
|
||||||
|
this.environmentService.environment$
|
||||||
|
.pipe(
|
||||||
|
take(1),
|
||||||
|
filter((env) => env.getRegion() === Region.SelfHosted),
|
||||||
|
takeUntil(this.destroy$),
|
||||||
|
)
|
||||||
|
.subscribe((env) => {
|
||||||
|
const urls = env.getUrls();
|
||||||
|
this.formGroup.patchValue({
|
||||||
|
webVaultUrl: urls.webVault || "",
|
||||||
|
apiUrl: urls.api || "",
|
||||||
|
identityUrl: urls.identity || "",
|
||||||
|
iconsUrl: urls.icons || "",
|
||||||
|
notificationsUrl: urls.notifications || "",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
submit = async () => {
|
submit = async () => {
|
||||||
this.showErrorSummary = false;
|
this.showErrorSummary = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user