Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
check on roomId instead of room
Browse files Browse the repository at this point in the history
  • Loading branch information
toger5 committed Nov 22, 2021
1 parent 57e11d3 commit 23a30fd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/views/voip/CallPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,14 @@ export default class CallPreview extends React.Component<IProps, IState> {
if (newRoomId === oldRoomId) return;
// The WidgetLayoutStore observer always tracks the currently viewed Room,
// so we don't end up with multiple observers and know what observer to remove on unmount
const newRoom = MatrixClientPeg.get().getRoom(newRoomId);
const oldRoom = MatrixClientPeg.get().getRoom(oldRoomId);
if (oldRoom) {
WidgetLayoutStore.instance.off(WidgetLayoutStore.emissionForRoom(oldRoom), this.updateCalls);
}
WidgetLayoutStore.instance.on(WidgetLayoutStore.emissionForRoom(newRoom), this.updateCalls);
const newRoom = MatrixClientPeg.get().getRoom(newRoomId);
if (newRoom) {
WidgetLayoutStore.instance.on(WidgetLayoutStore.emissionForRoom(newRoom), this.updateCalls);
}

const [primaryCall, secondaryCalls] = getPrimarySecondaryCallsForPip(newRoomId);
this.setState({
Expand Down

0 comments on commit 23a30fd

Please sign in to comment.