Conform more of the codebase to strictNullChecks (#10607)

* Conform more of the codebase to `strictNullChecks`

* Conform more of the codebase to `strictNullChecks`

* Fix types

* Conform more of the codebase to `strictNullChecks`

* Conform more of the codebase to `strictNullChecks`
This commit is contained in:
Michael Telatynski 2023-04-17 09:25:00 +01:00 committed by GitHub
parent 9d8d610f31
commit 56e4ae41f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 71 additions and 68 deletions

View file

@ -51,7 +51,7 @@ export default class DevicesPanelEntry extends React.Component<IProps, IState> {
super(props);
this.state = {
renaming: false,
displayName: props.device.display_name,
displayName: props.device.display_name ?? "",
};
}
@ -103,11 +103,11 @@ export default class DevicesPanelEntry extends React.Component<IProps, IState> {
});
} else {
const cli = MatrixClientPeg.get();
const userId = cli.getUserId()!;
const userId = cli.getSafeUserId();
const verificationRequestPromise = cli.requestVerification(userId, [this.props.device.device_id]);
Modal.createDialog(VerificationRequestDialog, {
verificationRequestPromise,
member: cli.getUser(userId),
member: cli.getUser(userId) ?? undefined,
onFinished: async (): Promise<void> => {
const request = await verificationRequestPromise;
request.cancel();