* PLT-6062 Don't show in-app notification if current channel * PLT-6131 make drawer titles all caps * PLT-6027 fix handle Push notifications for DM/GM
36 lines
1 KiB
JavaScript
36 lines
1 KiB
JavaScript
// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
|
|
import {bindActionCreators} from 'redux';
|
|
import {connect} from 'react-redux';
|
|
|
|
import {goToNotification, queueNotification} from 'app/actions/views/root';
|
|
import {setDeviceToken} from 'mattermost-redux/actions/general';
|
|
import {getUnreads} from 'mattermost-redux/selectors/entities/channels';
|
|
|
|
import PushNotification from './push_notification';
|
|
|
|
function mapStateToProps(state, ownProps) {
|
|
const {currentTeamId, teams} = state.entities.teams;
|
|
const {currentChannelId} = state.entities.channels;
|
|
|
|
return {
|
|
...ownProps,
|
|
currentTeamId,
|
|
currentChannelId,
|
|
teams,
|
|
...getUnreads(state)
|
|
};
|
|
}
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
return {
|
|
actions: bindActionCreators({
|
|
goToNotification,
|
|
queueNotification,
|
|
setDeviceToken
|
|
}, dispatch)
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(PushNotification);
|