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:
@@ -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();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user