Read room on open
This commit is contained in:
parent
8e67e75a09
commit
a4fda1820b
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue