Merge remote-tracking branch 'origin/master'

This commit is contained in:
Guilherme Gazzo 2017-08-10 13:49:15 -03:00
parent fecd0bdc57
commit 681a649a82
2 changed files with 7 additions and 4 deletions

View File

@ -46,7 +46,7 @@ export default class RoomView extends React.Component {
this.state = { this.state = {
dataSource: this.getMessages(), dataSource: this.getMessages(),
loaded: false, loaded: true,
joined: typeof props.navigation.state.params.rid === 'undefined' joined: typeof props.navigation.state.params.rid === 'undefined'
}; };
@ -54,9 +54,12 @@ export default class RoomView extends React.Component {
} }
componentWillMount() { componentWillMount() {
const late = setTimeout(() => this.setState({
loaded: false
}), 1000);
RocketChat.loadMessagesForRoom(this.rid, () => { RocketChat.loadMessagesForRoom(this.rid, () => {
clearTimeout(late);
this.setState({ this.setState({
...this.state,
loaded: true loaded: true
}); });
}); });

View File

@ -169,7 +169,7 @@ export default class RoomsListView extends React.Component {
}); });
} }
_onPressItem = (id, item) => { _onPressItem = (id, item = {}) => {
const { navigate } = this.props.navigation; const { navigate } = this.props.navigation;
const clearSearch = () => { const clearSearch = () => {
@ -222,7 +222,7 @@ export default class RoomsListView extends React.Component {
} }
renderItem = ({ item }) => ( renderItem = ({ item }) => (
<TouchableOpacity onPress={() => this._onPressItem(item._id)}> <TouchableOpacity onPress={() => this._onPressItem(item._id, item)}>
<RoomItem <RoomItem
id={item._id} id={item._id}
item={item} item={item}