Fix CallPreview `room is null` (#7265)

pull/21833/head
Michael Telatynski 2021-12-02 14:07:27 +00:00 committed by GitHub
parent aa7cae08aa
commit b5a488b01b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -133,8 +133,10 @@ export default class CallPreview extends React.Component<IProps, IState> {
}
SettingsStore.unwatchSetting(this.settingsWatcherRef);
const room = MatrixClientPeg.get().getRoom(this.state.roomId);
if (room) {
WidgetLayoutStore.instance.off(WidgetLayoutStore.emissionForRoom(room), this.updateCalls);
}
}
private onRoomViewStoreUpdate = () => {
const newRoomId = RoomViewStore.getRoomId();