Speeding up the url finder in the new post edit text.

This commit is contained in:
Vitor Pamplona
2024-05-14 20:32:48 -04:00
parent a9eeb04014
commit 4fa3d60638

View File

@@ -843,11 +843,7 @@ open class NewPostViewModel() : ViewModel() {
}
open fun findUrlInMessage(): String? {
return message.text.split('\n').firstNotNullOfOrNull { paragraph ->
paragraph.split(' ').firstOrNull { word: String ->
RichTextParser.isValidURL(word) || RichTextParser.isUrlWithoutScheme(word)
}
}
return RichTextParser().parseValidUrls(message.text).firstOrNull()
}
open fun removeFromReplyList(userToRemove: User) {