Fix CallPreview room is null (#7265) (#7348)

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
David Baker
2021-12-13 14:59:36 +00:00
committed by GitHub
co-authored by Michael Telatynski
parent b54a6d570e
commit 2ceed006aa
@@ -133,8 +133,10 @@ export default class CallPreview extends React.Component<IProps, IState> {
dis.unregister(this.dispatcherRef); dis.unregister(this.dispatcherRef);
SettingsStore.unwatchSetting(this.settingsWatcherRef); SettingsStore.unwatchSetting(this.settingsWatcherRef);
const room = MatrixClientPeg.get().getRoom(this.state.roomId); const room = MatrixClientPeg.get().getRoom(this.state.roomId);
if (room) {
WidgetLayoutStore.instance.off(WidgetLayoutStore.emissionForRoom(room), this.updateCalls); WidgetLayoutStore.instance.off(WidgetLayoutStore.emissionForRoom(room), this.updateCalls);
} }
}
private onRoomViewStoreUpdate = () => { private onRoomViewStoreUpdate = () => {
const newRoomId = RoomViewStore.getRoomId(); const newRoomId = RoomViewStore.getRoomId();