From fe9a1ebeaa9e8a4fd516648bbbb20bd1bc615056 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Sun, 19 Nov 2017 00:29:46 -0200 Subject: [PATCH] all room by param dont need get from realm again --- app/views/RoomView.js | 12 +++++------- app/views/RoomsListView.js | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/views/RoomView.js b/app/views/RoomView.js index acf6e53e..f60f0b8d 100644 --- a/app/views/RoomView.js +++ b/app/views/RoomView.js @@ -38,7 +38,7 @@ const styles = StyleSheet.create({ textAlign: 'center', color: '#a00' }, - header: { + loadingMore: { transform: [{ scaleY: -1 }], textAlign: 'center', padding: 5, @@ -86,7 +86,7 @@ export default class RoomView extends React.Component { .sorted('ts', true); this.state = { slow: false, - dataSource: [], + dataSource: ds.cloneWithRows(this.data), loaded: true, joined: typeof props.rid === 'undefined' }; @@ -124,14 +124,12 @@ export default class RoomView extends React.Component { this.state.end !== true ) { this.setState({ - // ...this.state, loadingMore: true }); const lastRowData = this.data[rowCount - 1]; RocketChat.loadMessagesForRoom(this.rid, lastRowData.ts, ({ end }) => { this.setState({ - // ...this.state, loadingMore: false, end }); @@ -186,11 +184,11 @@ export default class RoomView extends React.Component { renderHeader = () => { if (this.state.loadingMore) { - return Loading more messages...; + return Loading more messages...; } if (this.state.end) { - return Start of conversation; + return Start of conversation; } }; @@ -202,7 +200,7 @@ export default class RoomView extends React.Component {