mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-14 15:26:40 +10:00
better condition to tryMentionUserAction
This commit is contained in:
@@ -493,10 +493,13 @@ extension MessageToolbar: UITextViewDelegate {
|
||||
if let lastPart = parts.last {
|
||||
if lastPart.hasPrefix("@") {
|
||||
let usernamePrefix = lastPart.substringFromIndex(lastPart.startIndex.advancedBy(1))
|
||||
mentionUsernameRange = text.rangeOfString(lastPart)
|
||||
tryMentionUserAction?(usernamePrefix: usernamePrefix)
|
||||
|
||||
return
|
||||
if !usernamePrefix.isEmpty {
|
||||
mentionUsernameRange = text.rangeOfString(lastPart)
|
||||
tryMentionUserAction?(usernamePrefix: usernamePrefix)
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user