diff --git a/app/views/room.js b/app/views/room.js index 69619f2a..3fa23fa7 100644 --- a/app/views/room.js +++ b/app/views/room.js @@ -46,7 +46,7 @@ export default class RoomView extends React.Component { this.state = { dataSource: this.getMessages(), - loaded: false, + loaded: true, joined: typeof props.navigation.state.params.rid === 'undefined' }; @@ -54,9 +54,12 @@ export default class RoomView extends React.Component { } componentWillMount() { + const late = setTimeout(() => this.setState({ + loaded: false + }), 1000); RocketChat.loadMessagesForRoom(this.rid, () => { + clearTimeout(late); this.setState({ - ...this.state, loaded: true }); }); diff --git a/app/views/roomsList.js b/app/views/roomsList.js index bdbc9ff1..e8476e96 100644 --- a/app/views/roomsList.js +++ b/app/views/roomsList.js @@ -169,7 +169,7 @@ export default class RoomsListView extends React.Component { }); } - _onPressItem = (id, item) => { + _onPressItem = (id, item = {}) => { const { navigate } = this.props.navigation; const clearSearch = () => { @@ -222,7 +222,7 @@ export default class RoomsListView extends React.Component { } renderItem = ({ item }) => ( - this._onPressItem(item._id)}> + this._onPressItem(item._id, item)}>