mattermost-mobile/app/components/combined_system_message/index.js
Saturnino Abril 78acd89222 [MM-10727 and MM-10755] Fix missing username and styling issue of combined system messages (#1719)
* 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
2018-06-04 14:59:38 -04:00

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);