MM-13041: Not show direct channels without display name (#2388)

This commit is contained in:
Jesús Espino
2018-11-28 16:41:25 +01:00
parent b46f336c05
commit 83a23d3b9f

View File

@@ -24,9 +24,7 @@ export default class ChannelMentionItem extends PureComponent {
completeMention = () => {
const {onPress, displayName, name, type} = this.props;
if (type === General.DM_CHANNEL) {
onPress('@' + displayName.replace(/ /g, ''));
} else if (type === General.DM_CHANNEL) {
if (type === General.DM_CHANNEL || type === General.GM_CHANNEL) {
onPress('@' + displayName.replace(/ /g, ''));
} else {
onPress(name);
@@ -45,6 +43,9 @@ export default class ChannelMentionItem extends PureComponent {
const style = getStyleFromTheme(theme);
if (type === General.DM_CHANNEL || type === General.GM_CHANNEL) {
if (!displayName) {
return null;
}
return (
<TouchableOpacity
key={channelId}