[REGRESSION] Get rooms on app restore (#958)

This commit is contained in:
Diego Mello 2019-06-05 10:39:12 -03:00 committed by GitHub
parent 86b79be15e
commit 27de8c1f84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 12 deletions

View File

@ -19,8 +19,8 @@ import ServerDropdown from './ServerDropdown';
import { import {
toggleSortDropdown as toggleSortDropdownAction, toggleSortDropdown as toggleSortDropdownAction,
openSearchHeader as openSearchHeaderAction, openSearchHeader as openSearchHeaderAction,
closeSearchHeader as closeSearchHeaderAction closeSearchHeader as closeSearchHeaderAction,
// roomsRequest as roomsRequestAction roomsRequest as roomsRequestAction
} from '../../actions/rooms'; } from '../../actions/rooms';
import { appStart as appStartAction } from '../../actions'; import { appStart as appStartAction } from '../../actions';
import debounce from '../../utils/debounce'; import debounce from '../../utils/debounce';
@ -55,8 +55,8 @@ const keyExtractor = item => item.rid;
toggleSortDropdown: () => dispatch(toggleSortDropdownAction()), toggleSortDropdown: () => dispatch(toggleSortDropdownAction()),
openSearchHeader: () => dispatch(openSearchHeaderAction()), openSearchHeader: () => dispatch(openSearchHeaderAction()),
closeSearchHeader: () => dispatch(closeSearchHeaderAction()), closeSearchHeader: () => dispatch(closeSearchHeaderAction()),
appStart: () => dispatch(appStartAction()) appStart: () => dispatch(appStartAction()),
// roomsRequest: () => dispatch(roomsRequestAction()) roomsRequest: () => dispatch(roomsRequestAction())
})) }))
export default class RoomsListView extends React.Component { export default class RoomsListView extends React.Component {
static navigationOptions = ({ navigation }) => { static navigationOptions = ({ navigation }) => {
@ -104,12 +104,12 @@ export default class RoomsListView extends React.Component {
showUnread: PropTypes.bool, showUnread: PropTypes.bool,
useRealName: PropTypes.bool, useRealName: PropTypes.bool,
StoreLastMessage: PropTypes.bool, StoreLastMessage: PropTypes.bool,
// appState: PropTypes.string, appState: PropTypes.string,
toggleSortDropdown: PropTypes.func, toggleSortDropdown: PropTypes.func,
openSearchHeader: PropTypes.func, openSearchHeader: PropTypes.func,
closeSearchHeader: PropTypes.func, closeSearchHeader: PropTypes.func,
appStart: PropTypes.func appStart: PropTypes.func,
// roomsRequest: PropTypes.func roomsRequest: PropTypes.func
} }
constructor(props) { constructor(props) {
@ -185,7 +185,7 @@ export default class RoomsListView extends React.Component {
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
const { const {
sortBy, groupByType, showFavorites, showUnread sortBy, groupByType, showFavorites, showUnread, appState, roomsRequest
} = this.props; } = this.props;
if (!( if (!(
@ -195,11 +195,9 @@ export default class RoomsListView extends React.Component {
&& (prevProps.showUnread === showUnread) && (prevProps.showUnread === showUnread)
)) { )) {
this.getSubscriptions(); this.getSubscriptions();
} else if (appState === 'foreground' && appState !== prevProps.appState) {
roomsRequest();
} }
// removed for now... we may not need it anymore
// else if (appState === 'foreground' && appState !== prevProps.appState) {
// // roomsRequest();
// }
} }
componentWillUnmount() { componentWillUnmount() {