Files
mattermost-mobile/app/components/retry_bar_indicator/index.js
enahum f50b2b9412 Improving Performance Part 3 (#1011)
* Update mattermost-redux

* Tap on Deleted post to remove it

* Improvements when rendering post additional content

* Avoid unnecessary re-renders on the post list component

* Avoid unnecessary re-renders on the channel post list component

* Avoid unnecessary re-renders on the channel screen

* Feedback review
2017-10-11 14:54:13 -03:00

26 lines
769 B
JavaScript

// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {connect} from 'react-redux';
import {RequestStatus} from 'mattermost-redux/constants';
import {getConnection} from 'app/selectors/device';
import RetryBarIndicator from './retry_bar_indicator';
function mapStateToProps(state) {
const {websocket: websocketRequest} = state.requests.general;
const networkOnline = getConnection(state);
const webSocketOnline = websocketRequest.status === RequestStatus.SUCCESS;
let failed = state.views.channel.retryFailed && webSocketOnline;
if (!networkOnline) {
failed = false;
}
return {
failed
};
}
export default connect(mapStateToProps)(RetryBarIndicator);