Read room on open

This commit is contained in:
Guilherme Gazzo 2017-11-13 22:13:27 -02:00
parent 8e67e75a09
commit a4fda1820b
2 changed files with 2 additions and 1 deletions

View File

@ -10,6 +10,7 @@ const get = function* get({ rid }) {
} }
try { try {
yield RocketChat.loadMessagesForRoom(rid, null); yield RocketChat.loadMessagesForRoom(rid, null);
yield RocketChat.readMessages(rid);
yield put(messagesSuccess()); yield put(messagesSuccess());
} catch (err) { } catch (err) {
console.log(err); console.log(err);

View File

@ -105,7 +105,7 @@ export default class RoomView extends React.Component {
this.state.dataSource = ds.cloneWithRows(this.data); this.state.dataSource = ds.cloneWithRows(this.data);
} }
componentDidMount() { componentDidMount() {
InteractionManager.runAfterInteractions(() => RocketChat.readMessages(this.rid));
} }
componentDidUpdate() { componentDidUpdate() {
return !this.props.loading && clearTimeout(this.timer); return !this.props.loading && clearTimeout(this.timer);