forked from Ivasoft/mattermost-mobile
[MM-21408] Make the name displayed consistent with teammate name display (#4021)
* update redux hash and function * fix lint issue
This commit is contained in:
committed by
GitHub
parent
8b33b449d0
commit
e8150fa7cc
@@ -9,7 +9,7 @@ import {
|
||||
} from 'react-native';
|
||||
import {injectIntl, intlShape} from 'react-intl';
|
||||
|
||||
import {getFullName} from 'mattermost-redux/utils/user_utils';
|
||||
import {displayUsername} from 'mattermost-redux/utils/user_utils';
|
||||
import {General} from 'mattermost-redux/constants';
|
||||
|
||||
import {goToScreen} from 'app/actions/navigation';
|
||||
@@ -30,6 +30,7 @@ class ChannelIntro extends PureComponent {
|
||||
intl: intlShape.isRequired,
|
||||
theme: PropTypes.object.isRequired,
|
||||
isLandscape: PropTypes.bool.isRequired,
|
||||
teammateNameDisplay: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
@@ -48,11 +49,12 @@ class ChannelIntro extends PureComponent {
|
||||
};
|
||||
|
||||
getDisplayName = (member) => {
|
||||
const {teammateNameDisplay} = this.props;
|
||||
if (!member) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const displayName = getFullName(member);
|
||||
const displayName = displayUsername(member, teammateNameDisplay);
|
||||
|
||||
if (!displayName) {
|
||||
return member.username;
|
||||
|
||||
@@ -8,7 +8,7 @@ import {General} from 'mattermost-redux/constants';
|
||||
import {makeGetChannel} from 'mattermost-redux/selectors/entities/channels';
|
||||
import {getCurrentUserId, getUser, makeGetProfilesInChannel} from 'mattermost-redux/selectors/entities/users';
|
||||
|
||||
import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
|
||||
import {getTeammateNameDisplaySetting, getTheme} from 'mattermost-redux/selectors/entities/preferences';
|
||||
import {isLandscape} from 'app/selectors/device';
|
||||
import {getChannelMembersForDm} from 'app/selectors/channel';
|
||||
|
||||
@@ -49,6 +49,7 @@ function makeMapStateToProps() {
|
||||
currentChannelMembers,
|
||||
theme: getTheme(state),
|
||||
isLandscape: isLandscape(state),
|
||||
teammateNameDisplay: getTeammateNameDisplaySetting(state),
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -9955,8 +9955,8 @@
|
||||
}
|
||||
},
|
||||
"mattermost-redux": {
|
||||
"version": "github:mattermost/mattermost-redux#72bb238de055e9bda3e6cfe7663e5d738f7d05e4",
|
||||
"from": "github:mattermost/mattermost-redux#72bb238de055e9bda3e6cfe7663e5d738f7d05e4",
|
||||
"version": "github:mattermost/mattermost-redux#7c598c50a9d53e68503c8bc48ac258b09a15d1fb",
|
||||
"from": "github:mattermost/mattermost-redux#7c598c50a9d53e68503c8bc48ac258b09a15d1fb",
|
||||
"requires": {
|
||||
"core-js": "3.1.4",
|
||||
"form-data": "2.5.1",
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
"intl": "1.2.5",
|
||||
"jail-monkey": "2.3.1",
|
||||
"jsc-android": "241213.2.0",
|
||||
"mattermost-redux": "github:mattermost/mattermost-redux#72bb238de055e9bda3e6cfe7663e5d738f7d05e4",
|
||||
"mattermost-redux": "github:mattermost/mattermost-redux#7c598c50a9d53e68503c8bc48ac258b09a15d1fb",
|
||||
"mime-db": "1.43.0",
|
||||
"moment-timezone": "0.5.27",
|
||||
"prop-types": "15.7.2",
|
||||
|
||||
Reference in New Issue
Block a user