* MM-15323 autofill server Url when opening the app from deeplink (#10788) * MM-15323 move autofill logic into select-server screen * MM-15323 removes scheme on deeplink on select-server * MM-15323 fix serverURL wrong prop name * MM-15323: use getDerivedStateFromProps for setting state.url * MM-15323 revert serverUrl and fix unchangeable deeplink * MM-15323 fix props.serverUrl * MM-15323 move props.serverUrl into getDerivedStateFromProps * MM-15323 fix iOS deeplink issue Co-authored-by: mattermod <mattermod@users.noreply.github.com>
50 lines
1.7 KiB
JavaScript
50 lines
1.7 KiB
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {bindActionCreators} from 'redux';
|
|
import {connect} from 'react-redux';
|
|
|
|
import {setLastUpgradeCheck} from '@actions/views/client_upgrade';
|
|
import {loadConfigAndLicense} from '@actions/views/root';
|
|
import {handleServerUrlChanged} from '@actions/views/select_server';
|
|
import {scheduleExpiredNotification} from '@actions/views/session';
|
|
import {getPing, resetPing, setServerVersion} from '@mm-redux/actions/general';
|
|
import {login} from '@mm-redux/actions/users';
|
|
import {getConfig, getLicense} from '@mm-redux/selectors/entities/general';
|
|
import getClientUpgrade from '@selectors/client_upgrade';
|
|
|
|
import SelectServer from './select_server';
|
|
|
|
function mapStateToProps(state) {
|
|
const config = getConfig(state);
|
|
const license = getLicense(state);
|
|
const {currentVersion, latestVersion, minVersion} = getClientUpgrade(state);
|
|
|
|
return {
|
|
...state.views.selectServer,
|
|
config,
|
|
currentVersion,
|
|
deepLinkURL: state.views.root.deepLinkURL,
|
|
hasConfigAndLicense: Object.keys(config).length > 0 && Object.keys(license).length > 0,
|
|
latestVersion,
|
|
license,
|
|
minVersion,
|
|
};
|
|
}
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
return {
|
|
actions: bindActionCreators({
|
|
getPing,
|
|
scheduleExpiredNotification,
|
|
handleServerUrlChanged,
|
|
loadConfigAndLicense,
|
|
login,
|
|
resetPing,
|
|
setLastUpgradeCheck,
|
|
setServerVersion,
|
|
}, dispatch),
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(SelectServer);
|