mattermost-mobile/app/screens/channel/index.js
Hossein Ahmadian-Yazdi 55bd6a2f7e [MM-13849] Display confirmation box for [at]all and [at]channel (#3028)
* [MM-13849] Display confirmation box for @all and @channel

* [MM-13849] Fetch Channel stats when user changes channel

* [MM-13849] Address PR comments

* [MM-13849] Addressed PR comments

* [MM-13849] Made getChannelStats into it's own statement
2019-08-08 16:21:52 -04:00

61 lines
2.2 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 {startPeriodicStatusUpdates, stopPeriodicStatusUpdates, logout} from 'mattermost-redux/actions/users';
import {RequestStatus} from 'mattermost-redux/constants';
import {getCurrentChannelId} from 'mattermost-redux/selectors/entities/channels';
import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams';
import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
import {shouldShowTermsOfService} from 'mattermost-redux/selectors/entities/users';
import {getChannelStats} from 'mattermost-redux/actions/channels';
import {
loadChannelsIfNecessary,
loadProfilesAndTeamMembersForDMSidebar,
selectInitialChannel,
} from 'app/actions/views/channel';
import {connection} from 'app/actions/device';
import {recordLoadTime} from 'app/actions/views/root';
import {selectDefaultTeam} from 'app/actions/views/select_team';
import {peek, goToScreen, showModalOverCurrentContext} from 'app/actions/navigation';
import {isLandscape} from 'app/selectors/device';
import Channel from './channel';
function mapStateToProps(state) {
const {myChannels: channelsRequest} = state.requests.channels;
return {
channelsRequestFailed: channelsRequest.status === RequestStatus.FAILURE,
currentTeamId: getCurrentTeamId(state),
currentChannelId: getCurrentChannelId(state),
isLandscape: isLandscape(state),
theme: getTheme(state),
showTermsOfService: shouldShowTermsOfService(state),
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
getChannelStats,
connection,
loadChannelsIfNecessary,
loadProfilesAndTeamMembersForDMSidebar,
logout,
selectDefaultTeam,
selectInitialChannel,
recordLoadTime,
startPeriodicStatusUpdates,
stopPeriodicStatusUpdates,
peek,
goToScreen,
showModalOverCurrentContext,
}, dispatch),
};
}
export default connect(mapStateToProps, mapDispatchToProps)(Channel);