* fix missing username by supporting backward compatibility on `addedUsername` props when adding user to the channel or team Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com> * updated mattermost-redux with related PR merged
32 lines
1 KiB
JavaScript
32 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 {getProfilesByIds, getProfilesByUsernames} from 'mattermost-redux/actions/users';
|
|
|
|
import {getTeammateNameDisplaySetting} from 'mattermost-redux/selectors/entities/preferences';
|
|
import {getCurrentUser} from 'mattermost-redux/selectors/entities/users';
|
|
|
|
import CombinedSystemMessage from './combined_system_message';
|
|
|
|
function mapStateToProps(state) {
|
|
const currentUser = getCurrentUser(state);
|
|
return {
|
|
currentUserId: currentUser.id,
|
|
currentUsername: currentUser.username,
|
|
teammateNameDisplay: getTeammateNameDisplaySetting(state),
|
|
};
|
|
}
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
return {
|
|
actions: bindActionCreators({
|
|
getProfilesByIds,
|
|
getProfilesByUsernames,
|
|
}, dispatch),
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(CombinedSystemMessage);
|