mattermost-mobile/app/screens/settings/timezone/index.js
Miguel Alatzar 459801d10b
[MM-17560] Await dismissAllModals and popToRoot prior to calling showSearchModal (#3298)
* Patch react-native-navigation

* Make navigation actions regular functions

* Fix unhandled promise rejection warning

* Missing semicolons

* Mock navigation actions

* Add unit tests for navigation actions

* Place all patches in patches directory

* Fix channel_info snapshot test
2019-09-25 15:23:45 -07:00

40 lines
1.3 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
import {getSupportedTimezones} from 'mattermost-redux/actions/general';
import {getSupportedTimezones as getTimezones} from 'mattermost-redux/selectors/entities/general';
import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
import {getUserTimezone} from 'mattermost-redux/selectors/entities/timezone';
import {getCurrentUser} from 'mattermost-redux/selectors/entities/users';
import {isLandscape} from 'app/selectors/device';
import {updateUser} from 'app/actions/views/edit_profile';
import Timezone from './timezone';
function mapStateToProps(state) {
const timezones = getTimezones(state);
const currentUser = getCurrentUser(state) || {};
const userTimezone = getUserTimezone(state, currentUser.id);
return {
user: currentUser,
theme: getTheme(state),
userTimezone,
timezones,
isLandscape: isLandscape(state),
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
getSupportedTimezones,
updateUser,
}, dispatch),
};
}
export default connect(mapStateToProps, mapDispatchToProps)(Timezone);