mattermost-mobile/app/screens/channel_notification_preference/index.js
Elias Nahum e57bcfdaba
MM-30101 Match channel specific global notification preference (#4935)
* MM-30101 Match channel specific global notification preference

* Avoid crash if globalNotifyProps is undefined
2020-11-03 11:59:17 -07:00

27 lines
947 B
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 {updateChannelNotifyProps} from '@mm-redux/actions/channels';
import {getCurrentUser} from '@mm-redux/selectors/entities/users';
import {getTheme} from '@mm-redux/selectors/entities/preferences';
import {isLandscape} from 'app/selectors/device';
import ChannelNotificationPreference from './channel_notification_preference';
function mapStateToProps(state) {
return {
globalNotifyProps: getCurrentUser(state)?.notify_props,
isLandscape: isLandscape(state),
theme: getTheme(state),
};
}
const mapDispatchToProps = (dispatch) => ({
actions: bindActionCreators({
updateChannelNotifyProps,
}, dispatch),
});
export default connect(mapStateToProps, mapDispatchToProps)(ChannelNotificationPreference);