forked from Ivasoft/mattermost-mobile
MM-28450 Fix crash when posting at-mention that does not belong to the channel (#4778)
This commit is contained in:
@@ -141,9 +141,9 @@ export default class AtMention extends React.PureComponent {
|
||||
render() {
|
||||
const {isSearchResult, mentionName, mentionStyle, onPostPress, teammateNameDisplay, textStyle, mentionKeys} = this.props;
|
||||
const {user} = this.state;
|
||||
const {backgroundColor, ...styleText} = StyleSheet.flatten(textStyle);
|
||||
const mentionTextStyle = [];
|
||||
|
||||
let backgroundColor;
|
||||
let canPress = false;
|
||||
let highlighted;
|
||||
let isMention = false;
|
||||
@@ -152,6 +152,13 @@ export default class AtMention extends React.PureComponent {
|
||||
let onPress;
|
||||
let suffix;
|
||||
let suffixElement;
|
||||
let styleText;
|
||||
|
||||
if (textStyle) {
|
||||
const {backgroundColor: bg, ...otherStyles} = StyleSheet.flatten(textStyle);
|
||||
backgroundColor = bg;
|
||||
styleText = otherStyles;
|
||||
}
|
||||
|
||||
if (user?.username) {
|
||||
suffix = this.props.mentionName.substring(user.username.length);
|
||||
|
||||
Reference in New Issue
Block a user