Conform more code to strictNullChecks
(#10374)
* Apply `strictNullChecks` to `src/components/views/room_settings/*` * Restore tsconfig.json * Conform more code to `strictNullChecks` * Iterate * Update matrix-widget-api * Conform more code to `strictNullChecks`
This commit is contained in:
parent
9c816bb720
commit
1c9ea423c9
44 changed files with 223 additions and 179 deletions
|
@ -35,7 +35,7 @@ const ALGORITHM = "m.megolm.v1.aes-sha2";
|
|||
|
||||
const EncryptionEvent = forwardRef<HTMLDivElement, IProps>(({ mxEvent, timestamp }, ref) => {
|
||||
const cli = useContext(MatrixClientContext);
|
||||
const roomId = mxEvent.getRoomId();
|
||||
const roomId = mxEvent.getRoomId()!;
|
||||
const isRoomEncrypted = MatrixClientPeg.get().isRoomEncrypted(roomId);
|
||||
|
||||
const prevContent = mxEvent.getPrevContent() as IRoomEncryption;
|
||||
|
@ -51,13 +51,13 @@ const EncryptionEvent = forwardRef<HTMLDivElement, IProps>(({ mxEvent, timestamp
|
|||
if (prevContent.algorithm === ALGORITHM) {
|
||||
subtitle = _t("Some encryption parameters have been changed.");
|
||||
} else if (dmPartner) {
|
||||
const displayName = room.getMember(dmPartner)?.rawDisplayName || dmPartner;
|
||||
const displayName = room?.getMember(dmPartner)?.rawDisplayName || dmPartner;
|
||||
subtitle = _t(
|
||||
"Messages here are end-to-end encrypted. " +
|
||||
"Verify %(displayName)s in their profile - tap on their avatar.",
|
||||
{ displayName },
|
||||
);
|
||||
} else if (isLocalRoom(room)) {
|
||||
} else if (room && isLocalRoom(room)) {
|
||||
subtitle = _t("Messages in this chat will be end-to-end encrypted.");
|
||||
} else {
|
||||
subtitle = _t(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue