Skip to content

Commit

Permalink
Fixed a few bugs on the thread details screen.| #74
Browse files Browse the repository at this point in the history
  • Loading branch information
DenBond7 committed Nov 14, 2024
1 parent 5843754 commit f296269
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,9 @@ class ThreadDetailsViewModel(
candidatesToBeInserted.add(entity)
} else if (existingVersion.copy(id = null) != entity) {
candidatesToBeUpdated.add(entity.copy(id = existingVersion.id))
MsgsCacheManager.removeMessage(existingVersion.id.toString())
if (existingVersion.flags != entity.flags) {
MsgsCacheManager.removeMessage(existingVersion.id.toString())
}
}
}
val candidatesToBeDeleted =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ class ThreadDetailsFragment : BaseFragment<FragmentThreadDetailsBinding>(), Prog

private fun tryToOpenTheFreshestMessage(data: List<MessagesInThreadListAdapter.Item>) {
if (isActive && data.size > 1) {
val hasProcessedMessages = messagesInThreadListAdapter.currentList.any {
val hasProcessedMessages = data.any {
it is MessagesInThreadListAdapter.Message && it.incomingMessageInfo != null
}
val existing = messagesInThreadListAdapter.currentList.getOrNull(1)
Expand Down

0 comments on commit f296269

Please sign in to comment.