* MM-37934: adds CRT channel notification preferences Adds push notification preferences per channel for CRT replies. These are only enabled when push notifications for root messages are set to 'mention', in any other case we don't show the switch. * Adds another test case Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
29 lines
1 KiB
JavaScript
29 lines
1 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 {updateChannelNotifyProps} from '@mm-redux/actions/channels';
|
|
import {getTheme, isCollapsedThreadsEnabled} from '@mm-redux/selectors/entities/preferences';
|
|
import {getCurrentUser} from '@mm-redux/selectors/entities/users';
|
|
import {isLandscape} from '@selectors/device';
|
|
|
|
import ChannelNotificationPreference from './channel_notification_preference';
|
|
|
|
function mapStateToProps(state) {
|
|
return {
|
|
globalNotifyProps: getCurrentUser(state)?.notify_props,
|
|
isLandscape: isLandscape(state),
|
|
isCollapsedThreadsEnabled: isCollapsedThreadsEnabled(state),
|
|
theme: getTheme(state),
|
|
};
|
|
}
|
|
|
|
const mapDispatchToProps = (dispatch) => ({
|
|
actions: bindActionCreators({
|
|
updateChannelNotifyProps,
|
|
}, dispatch),
|
|
});
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(ChannelNotificationPreference);
|