Commit 3b576568 authored by Lucio Maciel's avatar Lucio Maciel
parent 107a4c86
...@@ -151,8 +151,8 @@ class ViewModelMapper @Inject constructor(private val context: Context, ...@@ -151,8 +151,8 @@ class ViewModelMapper @Inject constructor(private val context: Context,
} }
private fun getSenderName(message: Message): CharSequence { private fun getSenderName(message: Message): CharSequence {
message.senderAlias?.let { if (!message.senderAlias.isNullOrEmpty()) {
return it // Always give preference for Alias return message.senderAlias!!
} }
val username = message.sender?.username val username = message.sender?.username
......
...@@ -20,9 +20,7 @@ import chat.rocket.android.widget.DividerItemDecoration ...@@ -20,9 +20,7 @@ import chat.rocket.android.widget.DividerItemDecoration
import chat.rocket.core.model.ChatRoom import chat.rocket.core.model.ChatRoom
import dagger.android.support.AndroidSupportInjection import dagger.android.support.AndroidSupportInjection
import kotlinx.android.synthetic.main.fragment_chat_rooms.* import kotlinx.android.synthetic.main.fragment_chat_rooms.*
import kotlinx.coroutines.experimental.CommonPool
import kotlinx.coroutines.experimental.android.UI import kotlinx.coroutines.experimental.android.UI
import kotlinx.coroutines.experimental.async
import kotlinx.coroutines.experimental.launch import kotlinx.coroutines.experimental.launch
import javax.inject.Inject import javax.inject.Inject
...@@ -78,12 +76,15 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView { ...@@ -78,12 +76,15 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
activity.apply { activity.apply {
launch(UI) { launch(UI) {
val adapter = recycler_view.adapter as ChatRoomsAdapter val adapter = recycler_view.adapter as ChatRoomsAdapter
val diff = async(CommonPool) { // FIXME https://fabric.io/rocketchat3/android/apps/chat.rocket.android.dev/issues/5a90d4718cb3c2fa63b3f557?time=last-seven-days
// TODO - fix this bug to reenable DiffUtil
/*val diff = async(CommonPool) {
DiffUtil.calculateDiff(RoomsDiffCallback(adapter.dataSet, newDataSet)) DiffUtil.calculateDiff(RoomsDiffCallback(adapter.dataSet, newDataSet))
}.await() }.await()*/
adapter.updateRooms(newDataSet) adapter.updateRooms(newDataSet)
diff.dispatchUpdatesTo(adapter) adapter.notifyDataSetChanged()
//diff.dispatchUpdatesTo(adapter)
} }
} }
} }
......
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