fix(regression/cs2): limit amt of replies

Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
Infi 2024-06-03 19:56:11 +02:00
parent d119f7b47f
commit fe2efdaec0
1 changed files with 2 additions and 0 deletions

View File

@ -234,7 +234,9 @@ class ChannelScreenViewModel @Inject constructor(
}
suspend fun addReplyTo(messageId: String) {
if (draftReplyTo.size >= 5) return
if (draftReplyTo.any { it.id == messageId }) return
val shouldMention = kvStorage.getBoolean("mentionOnReply") ?: false
draftReplyTo.add(SendMessageReply(messageId, shouldMention))
}