Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
RocketChat
Rocket.Chat.ReactNative
Commits
400d3325
Unverified
Commit
400d3325
authored
Feb 13, 2020
by
Diego Mello
Committed by
GitHub
Feb 13, 2020
Browse files
[REGRESSION] Remove @ and # from mention (#1721)
parent
88c0ba6a
Changes
3
Hide whitespace changes
Inline
Side-by-side
__tests__/__snapshots__/Storyshots.test.js.snap
View file @
400d3325
...
...
@@ -4723,7 +4723,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
@
rocket.cat
rocket.cat
</Text>
<Text
numberOfLines={0}
...
...
@@ -4766,7 +4766,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
@
diego.mello
diego.mello
</Text>
<Text
numberOfLines={0}
...
...
@@ -4809,7 +4809,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
@
all
all
</Text>
<Text
numberOfLines={0}
...
...
@@ -4852,7 +4852,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
@
here
here
</Text>
<Text
numberOfLines={0}
...
...
@@ -4895,7 +4895,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
#
general
general
</Text>
</Text>
</View>
...
...
app/containers/markdown/AtMention.js
View file @
400d3325
...
...
@@ -28,21 +28,27 @@ const AtMention = React.memo(({
}
const
handlePress
=
()
=>
{
if
(
mentions
&&
mentions
.
length
&&
mentions
.
findIndex
(
m
=>
m
.
username
===
mention
)
!==
-
1
)
{
const
index
=
mentions
.
findIndex
(
m
=>
m
.
username
===
mention
);
const
navParam
=
{
t
:
'
d
'
,
rid
:
mentions
[
index
].
_id
};
navToRoomInfo
(
navParam
);
}
const
index
=
mentions
.
findIndex
(
m
=>
m
.
username
===
mention
);
const
navParam
=
{
t
:
'
d
'
,
rid
:
mentions
[
index
].
_id
};
navToRoomInfo
(
navParam
);
};
if
(
mentions
&&
mentions
.
length
&&
mentions
.
findIndex
(
m
=>
m
.
username
===
mention
)
!==
-
1
)
{
return
(
<
Text
style
=
{[
preview
?
{
...
styles
.
text
,
color
:
themes
[
theme
].
bodyText
}
:
mentionStyle
,
...
style
]}
onPress
=
{
preview
?
undefined
:
handlePress
}
>
{
mention
}
<
/Text
>
);
}
return
(
<
Text
style
=
{[
preview
?
{
...
styles
.
text
,
color
:
themes
[
theme
].
bodyText
}
:
mentionStyle
,
...
style
]}
onPress
=
{
preview
?
undefined
:
handlePress
}
>
<
Text
style
=
{[
styles
.
text
,
{
color
:
themes
[
theme
].
bodyText
},
...
style
]}
>
{
`@
${
mention
}
`
}
<
/Text
>
);
...
...
app/containers/markdown/Hashtag.js
View file @
400d3325
...
...
@@ -24,12 +24,12 @@ const Hashtag = React.memo(({
style
=
{[
preview
?
{
...
styles
.
text
,
color
:
themes
[
theme
].
bodyText
}
:
styles
.
mention
,
...
style
]}
onPress
=
{
preview
?
undefined
:
handlePress
}
>
{
`#
${
hashtag
}
`
}
{
hashtag
}
<
/Text
>
);
}
return
(
<
Text
style
=
{[
preview
?
{
...
styles
.
text
,
color
:
themes
[
theme
].
bodyText
}
:
styles
.
mention
,
...
style
]}
>
<
Text
style
=
{[
styles
.
text
,
{
color
:
themes
[
theme
].
bodyText
},
...
style
]}
>
{
`#
${
hashtag
}
`
}
<
/Text
>
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment