* Handle group synced channel highlighting better * Add tests * Dont check if teamRoleFound if no teamId given for haveIChannelPermission * Pass team id for channel mentions and group mentions checks * Actually make a selector * Check for falsey teamId instead of undefined * Remove true && * Iterate over object values instead of for in
26 lines
928 B
JavaScript
26 lines
928 B
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {connect} from 'react-redux';
|
|
|
|
import {getUsersByUsername} from '@mm-redux/selectors/entities/users';
|
|
|
|
import {getAllUserMentionKeys} from '@mm-redux/selectors/entities/search';
|
|
|
|
import {getTeammateNameDisplaySetting, getTheme} from '@mm-redux/selectors/entities/preferences';
|
|
|
|
import {getAllGroupsForReferenceByName} from '@mm-redux/selectors/entities/groups';
|
|
|
|
import AtMention from './at_mention';
|
|
|
|
function mapStateToProps(state, ownProps) {
|
|
return {
|
|
theme: getTheme(state),
|
|
usersByUsername: getUsersByUsername(state),
|
|
mentionKeys: ownProps.mentionKeys || getAllUserMentionKeys(state),
|
|
teammateNameDisplay: getTeammateNameDisplaySetting(state),
|
|
groupsByName: getAllGroupsForReferenceByName(state),
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps)(AtMention);
|