From a4fda1820bae6197553302cc5b9b62217e519fea Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Mon, 13 Nov 2017 22:13:27 -0200 Subject: [PATCH] Read room on open --- app/sagas/messages.js | 1 + app/views/RoomView.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/sagas/messages.js b/app/sagas/messages.js index e21b28ce..fc4aff76 100644 --- a/app/sagas/messages.js +++ b/app/sagas/messages.js @@ -10,6 +10,7 @@ const get = function* get({ rid }) { } try { yield RocketChat.loadMessagesForRoom(rid, null); + yield RocketChat.readMessages(rid); yield put(messagesSuccess()); } catch (err) { console.log(err); diff --git a/app/views/RoomView.js b/app/views/RoomView.js index 817786b6..f50db0e9 100644 --- a/app/views/RoomView.js +++ b/app/views/RoomView.js @@ -105,7 +105,7 @@ export default class RoomView extends React.Component { this.state.dataSource = ds.cloneWithRows(this.data); } componentDidMount() { - InteractionManager.runAfterInteractions(() => RocketChat.readMessages(this.rid)); + } componentDidUpdate() { return !this.props.loading && clearTimeout(this.timer);