Apply strictNullChecks to src/components/auth/* (#10484

* Apply `strictNullChecks` to `src/components/auth/*`

* fix

* strict types
This commit is contained in:
Michael Telatynski
2023-03-31 09:26:15 +01:00
committed by GitHub
parent af151700c9
commit f152613f83
8 changed files with 25 additions and 17 deletions

View File

@@ -39,8 +39,8 @@ interface IProps {
interface IState {
phase: Phase;
verificationRequest: VerificationRequest;
backupInfo: IKeyBackupInfo;
verificationRequest: VerificationRequest | null;
backupInfo: IKeyBackupInfo | null;
lostKeys: boolean;
}
@@ -96,7 +96,7 @@ export default class SetupEncryptionBody extends React.Component<IProps, IState>
this.props.onFinished();
Modal.createDialog(VerificationRequestDialog, {
verificationRequestPromise: requestPromise,
member: cli.getUser(userId),
member: cli.getUser(userId) ?? undefined,
onFinished: async (): Promise<void> => {
const request = await requestPromise;
request.cancel();
@@ -142,15 +142,16 @@ export default class SetupEncryptionBody extends React.Component<IProps, IState>
};
public render(): React.ReactNode {
const cli = MatrixClientPeg.get();
const { phase, lostKeys } = this.state;
if (this.state.verificationRequest) {
if (this.state.verificationRequest && cli.getUser(this.state.verificationRequest.otherUserId)) {
return (
<EncryptionPanel
layout="dialog"
verificationRequest={this.state.verificationRequest}
onClose={this.onEncryptionPanelClose}
member={MatrixClientPeg.get().getUser(this.state.verificationRequest.otherUserId)}
member={cli.getUser(this.state.verificationRequest.otherUserId)!}
isRoomEncrypted={false}
/>
);