Commit fb715293 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Fix bug when mapping a message to view model

parent de0c27e7
...@@ -107,8 +107,8 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView, ...@@ -107,8 +107,8 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView,
private fun updateMessage(streamedMessage: Message) { private fun updateMessage(streamedMessage: Message) {
launchUI(strategy) { launchUI(strategy) {
synchronized(roomMessages) {
val viewModelStreamedMessage = MessageViewModelMapper.mapToViewModel(streamedMessage, settings) val viewModelStreamedMessage = MessageViewModelMapper.mapToViewModel(streamedMessage, settings)
synchronized(roomMessages) {
val index = roomMessages.indexOfFirst { msg -> msg.id == streamedMessage.id } val index = roomMessages.indexOfFirst { msg -> msg.id == streamedMessage.id }
if (index != -1) { if (index != -1) {
Timber.d("Updatind message at $index") Timber.d("Updatind message at $index")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment