diff --git a/app/views/RoomView/index.tsx b/app/views/RoomView/index.tsx index 81ac5d5a8..ff814c9f8 100644 --- a/app/views/RoomView/index.tsx +++ b/app/views/RoomView/index.tsx @@ -303,7 +303,7 @@ class RoomView extends React.Component { }; this.setHeader(); - if (room && room.observe) { + if (room && room.observe()) { this.observeRoom(room); } else if (this.rid) { this.findAndObserveRoom(this.rid); @@ -702,11 +702,11 @@ class RoomView extends React.Component { delete this.sub; }; - observeRoom = (room: IRoom) => { + observeRoom = (room: TRoomModel) => { if (room.observe) { const observable = room.observe(); - this.subSubscription = observable.subscribe((changes: any) => { - const roomUpdate = roomAttrsUpdate.reduce((ret: any, attr: any) => { + this.subSubscription = observable.subscribe(changes => { + const roomUpdate = roomAttrsUpdate.reduce((ret: any, attr) => { ret[attr] = changes[attr]; return ret; }, {});