Avoid race condition with TextFuture when setting message text

Change-Id: I7de99faf565b73a67aceeaf646fec6e6d56123c8
This commit is contained in:
SpiritCroc 2021-10-29 18:36:41 +02:00
parent bbb2a631cf
commit 57d3f3bc68
1 changed files with 2 additions and 0 deletions

View File

@ -122,6 +122,8 @@ abstract class MessageTextItem : AbsMessageItem<MessageTextItem.Holder>() {
if (canUseTextFuture) { if (canUseTextFuture) {
holder.messageView.setTextFuture(textFuture) holder.messageView.setTextFuture(textFuture)
} else { } else {
// Remove possible previously set futures that might overwrite our text
holder.messageView.setTextFuture(null)
holder.messageView.text = message holder.messageView.text = message
} }
} }