mattermost-mobile/app/screens/select_server/index.js
Harrison Healey 1f0dd960f6 RN-469 Added the ability to cancel a ping when on the select server screen (#1234)
* RN-469 Added the ability to cancel a ping when on the select server screen

* RN-369 Added i18n strings for new button

* Made sure config and license are downloaded before moving to login screen

* Have SelectServer screen still show connecting while waiting for config

* Don't show SelectServer screen as connected if an error occurs
2017-11-30 20:13:23 -03:00

45 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} from 'mattermost-redux/actions/general';
import {RequestStatus} from 'mattermost-redux/constants';
import {setLastUpgradeCheck} from 'app/actions/views/client_upgrade';
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: configRequest, license: licenseRequest} = state.requests.general;
const {config, license} = state.entities.general;
const {currentVersion, latestVersion, minVersion} = getClientUpgrade(state);
return {
...state.views.selectServer,
config,
currentVersion,
hasConfigAndLicense: configRequest.status === RequestStatus.SUCCESS && licenseRequest.status === RequestStatus.SUCCESS,
latestVersion,
license,
minVersion,
theme: getTheme(state)
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
getPing,
handleServerUrlChanged,
resetPing,
setLastUpgradeCheck
}, dispatch)
};
}
export default connect(mapStateToProps, mapDispatchToProps)(SelectServer);