mattermost-mobile/app/screens/select_server/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

46 lines
1.5 KiB
JavaScript

// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {getPing, resetPing, setServerVersion} from 'mattermost-redux/actions/general';
import {setLastUpgradeCheck} from 'app/actions/views/client_upgrade';
import {loadConfigAndLicense} from 'app/actions/views/root';
import {handleServerUrlChanged} from 'app/actions/views/select_server';
import getClientUpgrade from 'app/selectors/client_upgrade';
import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
import SelectServer from './select_server';
function mapStateToProps(state) {
const {config, license} = state.entities.general;
const {currentVersion, latestVersion, minVersion} = getClientUpgrade(state);
return {
...state.views.selectServer,
config,
currentVersion,
hasConfigAndLicense: Object.keys(config).length > 0 && Object.keys(license).length > 0,
latestVersion,
license,
minVersion,
theme: getTheme(state),
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
getPing,
handleServerUrlChanged,
loadConfigAndLicense,
resetPing,
setLastUpgradeCheck,
setServerVersion,
}, dispatch),
};
}
export default connect(mapStateToProps, mapDispatchToProps)(SelectServer);