mattermost-mobile/app/components/offline_indicator/index.js
enahum f8414559b2 Improving Performance Part 2 (#1010)
* Remove serverVersion check to allow GitLab login

* Avoid unncessary re-renders on the root screen

* Avoid unncessary re-renders on the options modal screen

* Avoid unncessary re-renders on the thread screen

* Avoid unncessary re-renders on the offline indicator component

* Avoid unncessary re-renders on the channel loader component

* review feedback
2017-10-11 14:36:27 -03:00

22 lines
600 B
JavaScript

// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {connect} from 'react-redux';
import {getConnection} from 'app/selectors/device';
import OfflineIndicator from './offline_indicator';
function mapStateToProps(state) {
const {websocket} = state.requests.general;
const webSocketStatus = websocket.status;
const isConnecting = websocket.error > 1;
return {
isConnecting,
isOnline: getConnection(state),
webSocketStatus
};
}
export default connect(mapStateToProps)(OfflineIndicator);