Apply strictNullChecks to src/components/auth/* (#10484
* Apply `strictNullChecks` to `src/components/auth/*` * fix * strict types
This commit is contained in:
committed by
GitHub
parent
af151700c9
commit
f152613f83
@@ -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}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user