Fix chat message file transfer status when leaving & going back into conversation

This commit is contained in:
Sylvain Berfini 2024-12-24 13:19:45 +01:00
parent b084807d18
commit 942e78eede
2 changed files with 3 additions and 3 deletions

View file

@ -247,8 +247,7 @@ class MessageModel
) {
val percent = ((offset * 100.0) / total).toInt() // Conversion from int to double and back to int is required
val model = transferringFileModel
if (model == null) {
if (transferringFileModel == null) {
Log.w("$TAG A file is being uploaded/downloaded but no transferringFileModel set!")
val found = filesList.value.orEmpty().find {
it.fileName == content.name
@ -262,7 +261,7 @@ class MessageModel
)
}
}
model?.updateTransferProgress(percent)
transferringFileModel?.updateTransferProgress(percent)
}
@WorkerThread

View file

@ -71,6 +71,7 @@
android:layout_height="0dp"
android:visibility="@{viewModel.videoUpdateInProgress ? View.VISIBLE : View.GONE}"
android:indeterminate="true"
app:indicatorColor="?attr/color_main1_500"
app:layout_constraintTop_toTopOf="@id/toggle_video"
app:layout_constraintBottom_toBottomOf="@id/toggle_video"
app:layout_constraintStart_toStartOf="@id/toggle_video"