1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-08 20:50:28 +00:00

[PM-18721] add type check for ViewChild components

This commit is contained in:
rr-bw
2025-05-24 15:03:52 -07:00
parent cc5c60d374
commit d07fd4663a
2 changed files with 13 additions and 2 deletions

View File

@@ -62,7 +62,7 @@ type EmergencyAccessTakeoverDialogResultType =
})
export class EmergencyAccessTakeoverDialogComponent implements OnInit, AfterViewInit {
@ViewChild(InputPasswordComponent)
inputPasswordComponent!: InputPasswordComponent;
inputPasswordComponent: InputPasswordComponent | undefined = undefined;
private submittingBehaviorSubject = new BehaviorSubject(false);
submitting$ = this.submittingBehaviorSubject.asObservable();
@@ -108,6 +108,10 @@ export class EmergencyAccessTakeoverDialogComponent implements OnInit, AfterView
}
protected handlePrimaryButtonClick = async () => {
if (!this.inputPasswordComponent) {
throw new Error("InputPasswordComponent is not initialized");
}
await this.inputPasswordComponent.submit();
};