Skip to content

Commit

Permalink
Fixed updating messages on the thread details screen after sending a …
Browse files Browse the repository at this point in the history
…message.| #74
  • Loading branch information
DenBond7 committed Nov 25, 2024
1 parent 2a88f6e commit f4952c5
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -935,16 +935,14 @@ class ThreadDetailsFragment : BaseFragment<FragmentThreadDetailsBinding>(), Prog
workInfo.progress.getLong(MessagesSenderWorker.EXTRA_KEY_THREAD_ID_OF_SENT_MESSAGE, -1)
val draftId = workInfo.progress.getString(MessagesSenderWorker.EXTRA_KEY_ID_OF_SENT_DRAFT)

when {
!draftId.isNullOrEmpty() -> {
deleteDraftFromLocalCache(draftId)
}
if (!draftId.isNullOrEmpty()) {
deleteDraftFromLocalCache(draftId)
}

threadIdOfSentMessage != -1L -> {
val currentThreadId = threadDetailsViewModel.threadMessageEntityFlow.value?.threadId
if (currentThreadId == threadIdOfSentMessage) {
threadDetailsViewModel.loadMessages(silentUpdate = true)
}
if (threadIdOfSentMessage != -1L) {
val currentThreadId = threadDetailsViewModel.threadMessageEntityFlow.value?.threadId
if (currentThreadId == threadIdOfSentMessage) {
threadDetailsViewModel.loadMessages(silentUpdate = true)
}
}
}
Expand Down

0 comments on commit f4952c5

Please sign in to comment.