[FIX] Dispatch roomsRequest on app foreground event even if not connected (#1234)
This commit is contained in:
parent
2e5c4b9b73
commit
c9d016376c
|
@ -57,8 +57,7 @@ const shouldUpdateProps = [
|
||||||
'showUnread',
|
'showUnread',
|
||||||
'useRealName',
|
'useRealName',
|
||||||
'StoreLastMessage',
|
'StoreLastMessage',
|
||||||
'appState',
|
'appState'
|
||||||
'isAuthenticated'
|
|
||||||
];
|
];
|
||||||
const getItemLayout = (data, index) => ({
|
const getItemLayout = (data, index) => ({
|
||||||
length: ROW_HEIGHT,
|
length: ROW_HEIGHT,
|
||||||
|
@ -139,8 +138,7 @@ class RoomsListView extends React.Component {
|
||||||
openSearchHeader: PropTypes.func,
|
openSearchHeader: PropTypes.func,
|
||||||
closeSearchHeader: PropTypes.func,
|
closeSearchHeader: PropTypes.func,
|
||||||
appStart: PropTypes.func,
|
appStart: PropTypes.func,
|
||||||
roomsRequest: PropTypes.func,
|
roomsRequest: PropTypes.func
|
||||||
isAuthenticated: PropTypes.bool
|
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
@ -264,8 +262,7 @@ class RoomsListView extends React.Component {
|
||||||
showFavorites,
|
showFavorites,
|
||||||
showUnread,
|
showUnread,
|
||||||
appState,
|
appState,
|
||||||
roomsRequest,
|
roomsRequest
|
||||||
isAuthenticated
|
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
@ -280,7 +277,6 @@ class RoomsListView extends React.Component {
|
||||||
} else if (
|
} else if (
|
||||||
appState === 'foreground'
|
appState === 'foreground'
|
||||||
&& appState !== prevProps.appState
|
&& appState !== prevProps.appState
|
||||||
&& isAuthenticated
|
|
||||||
) {
|
) {
|
||||||
roomsRequest();
|
roomsRequest();
|
||||||
}
|
}
|
||||||
|
@ -801,7 +797,6 @@ const mapStateToProps = state => ({
|
||||||
userId: state.login.user && state.login.user.id,
|
userId: state.login.user && state.login.user.id,
|
||||||
username: state.login.user && state.login.user.username,
|
username: state.login.user && state.login.user.username,
|
||||||
token: state.login.user && state.login.user.token,
|
token: state.login.user && state.login.user.token,
|
||||||
isAuthenticated: state.login.isAuthenticated,
|
|
||||||
server: state.server.server,
|
server: state.server.server,
|
||||||
baseUrl: state.settings.baseUrl || state.server ? state.server.server : '',
|
baseUrl: state.settings.baseUrl || state.server ? state.server.server : '',
|
||||||
searchText: state.rooms.searchText,
|
searchText: state.rooms.searchText,
|
||||||
|
|
Loading…
Reference in New Issue