Fixed crash when downloading more than one file consecutively
This commit is contained in:
parent
b3ebaae360
commit
7545961ffb
1 changed files with 6 additions and 2 deletions
|
@ -72,10 +72,14 @@ class ChatMessageContentViewModel(
|
|||
offset: Int,
|
||||
total: Int
|
||||
) {
|
||||
if (c.filePath == content.filePath) {
|
||||
val percent = offset * 100 / total
|
||||
if (!c.filePath.isNullOrEmpty() && !content.filePath.isNullOrEmpty() && c.filePath == content.filePath) {
|
||||
Log.d("[Content] Download progress is: $offset / $total ($percent%)")
|
||||
downloadProgress.postValue(percent)
|
||||
|
||||
if (offset == total) {
|
||||
chatMessage.removeListener(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue