From 8192b391ea7684d438496100eb3fa3ead4059a95 Mon Sep 17 00:00:00 2001 From: AlexAlexandre Date: Thu, 16 Dec 2021 21:22:22 -0300 Subject: [PATCH] fix room.observer problem --- app/views/RoomView/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; }, {});