From 8cbccdfb2365b8deaca068b7a06ad0d6eb23aad8 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Mon, 13 Nov 2017 22:13:27 -0200 Subject: [PATCH] Read room on open --- app/sagas/messages.js | 1 + app/views/RoomView.js | 29 ++++++++++++----------------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/app/sagas/messages.js b/app/sagas/messages.js index e21b28ce..fc4aff76 100644 --- a/app/sagas/messages.js +++ b/app/sagas/messages.js @@ -10,6 +10,7 @@ const get = function* get({ rid }) { } try { yield RocketChat.loadMessagesForRoom(rid, null); + yield RocketChat.readMessages(rid); yield put(messagesSuccess()); } catch (err) { console.log(err); diff --git a/app/views/RoomView.js b/app/views/RoomView.js index 817786b6..4f7252c7 100644 --- a/app/views/RoomView.js +++ b/app/views/RoomView.js @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { Text, View, StyleSheet, Button, InteractionManager, SafeAreaView } from 'react-native'; +import { Text, View, StyleSheet, Button } from 'react-native'; import { ListView } from 'realm/react-native'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; @@ -19,9 +19,6 @@ const styles = StyleSheet.create({ flex: 1, backgroundColor: '#fff' }, - safeAreaView: { - flex: 1 - }, list: { flex: 1, transform: [{ scaleY: -1 }] @@ -196,20 +193,18 @@ export default class RoomView extends React.Component { render() { return ( - + {this.renderBanner()} - - this.renderItem({ item })} - initialListSize={10} - /> - + this.renderItem({ item })} + initialListSize={10} + /> {this.renderFooter()} );