1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-07 12:13:45 +00:00

[PM-18721] add initializing property

This commit is contained in:
rr-bw
2025-05-22 11:53:29 -07:00
parent 8c062e9447
commit 2a15b5cf63
2 changed files with 29 additions and 15 deletions

View File

@@ -5,15 +5,26 @@
</span>
<div bitDialogContent>
<bit-callout type="warning">{{
"emergencyAccessLoggedOutWarning" | i18n: dialogData.grantorName
}}</bit-callout>
@if (initializing) {
<div class="tw-flex tw-items-center tw-justify-center">
<i
class="bwi bwi-spinner bwi-spin bwi-2x tw-text-muted"
title="{{ 'loading' | i18n }}"
aria-hidden="true"
></i>
<span class="tw-sr-only">{{ "loading" | i18n }}</span>
</div>
} @else {
<bit-callout type="warning">{{
"emergencyAccessLoggedOutWarning" | i18n: dialogData.grantorName
}}</bit-callout>
<auth-input-password
[flow]="inputPasswordFlow"
[masterPasswordPolicyOptions]="masterPasswordPolicyOptions"
(onPasswordFormSubmit)="handlePasswordFormSubmit($event)"
></auth-input-password>
<auth-input-password
[flow]="inputPasswordFlow"
[masterPasswordPolicyOptions]="masterPasswordPolicyOptions"
(onPasswordFormSubmit)="handlePasswordFormSubmit($event)"
></auth-input-password>
}
</div>
<ng-container bitDialogFooter>

View File

@@ -65,6 +65,7 @@ export class EmergencyAccessTakeoverDialogComponent implements OnInit {
@ViewChild(InputPasswordComponent)
inputPasswordComponent!: InputPasswordComponent;
initializing = true;
inputPasswordFlow = InputPasswordFlow.ChangePasswordDelegation;
masterPasswordPolicyOptions?: MasterPasswordPolicyOptions;
@@ -80,14 +81,16 @@ export class EmergencyAccessTakeoverDialogComponent implements OnInit {
) {}
async ngOnInit() {
const activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
const grantorPolicies = await this.emergencyAccessService.getGrantorPolicies(
this.dialogData.emergencyAccessId,
);
// const activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId));
// const grantorPolicies = await this.emergencyAccessService.getGrantorPolicies(
// this.dialogData.emergencyAccessId,
// );
this.masterPasswordPolicyOptions = await firstValueFrom(
this.policyService.masterPasswordPolicyOptions$(activeUserId, grantorPolicies),
);
// this.masterPasswordPolicyOptions = await firstValueFrom(
// this.policyService.masterPasswordPolicyOptions$(activeUserId, grantorPolicies),
// );
this.initializing = false;
}
protected handlePrimaryButtonClick = async () => {