mattermost-mobile/app/components/offline_indicator/index.js
Jesse Hallam 58b72302d6 update eslint's comma-dangle rule to always-multiline (#1457)
* update eslint's `comma-dangle` rule to `always-multiline`

* add check and fix scripts to package.json

* Invoke `yarn fix` to adopt the updated eslint rules. No other changes are included.
2018-02-23 09:06:02 -05:00

36 lines
1,013 B
JavaScript

// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {init as initWebSocket} from 'mattermost-redux/actions/websocket';
import {connection} from 'app/actions/device';
import {getConnection, isLandscape} 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,
isLandscape: isLandscape(state),
isOnline: getConnection(state),
webSocketStatus,
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
connection,
initWebSocket,
}, dispatch),
};
}
export default connect(mapStateToProps, mapDispatchToProps)(OfflineIndicator);