Conform more of the codebase to strict typescript (#10841)
This commit is contained in:
parent
af78a5a2f5
commit
277a3c0146
12 changed files with 89 additions and 60 deletions
|
@ -152,13 +152,10 @@ class EditMessageComposer extends React.Component<IEditMessageComposerProps, ISt
|
|||
}
|
||||
|
||||
private getRoom(): Room {
|
||||
const roomId = this.props.editState.getEvent().getRoomId();
|
||||
const room = this.props.mxClient.getRoom(roomId);
|
||||
// Something is very wrong if we encounter this
|
||||
if (!room) {
|
||||
throw new Error(`Cannot find room for event ${roomId}`);
|
||||
if (!this.context.room) {
|
||||
throw new Error(`Cannot render without room`);
|
||||
}
|
||||
return room;
|
||||
return this.context.room;
|
||||
}
|
||||
|
||||
private onKeyDown = (event: KeyboardEvent): void => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue