mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-04-24 04:38:31 +00:00
Fixed crash when downloading more than one file consecutively
This commit is contained in:
parent
07c0440a0f
commit
fcfb0b40e4
1 changed files with 6 additions and 2 deletions
|
|
@ -72,10 +72,14 @@ class ChatMessageContentViewModel(
|
||||||
offset: Int,
|
offset: Int,
|
||||||
total: Int
|
total: Int
|
||||||
) {
|
) {
|
||||||
val percent = offset * 100 / total
|
if (c.filePath == content.filePath) {
|
||||||
if (!c.filePath.isNullOrEmpty() && !content.filePath.isNullOrEmpty() && c.filePath == content.filePath) {
|
val percent = offset * 100 / total
|
||||||
Log.d("[Content] Download progress is: $offset / $total ($percent%)")
|
Log.d("[Content] Download progress is: $offset / $total ($percent%)")
|
||||||
downloadProgress.postValue(percent)
|
downloadProgress.postValue(percent)
|
||||||
|
|
||||||
|
if (offset == total) {
|
||||||
|
chatMessage.removeListener(this)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue