Reset upload progress if attachment upload is interrupted.

This commit is contained in:
Nicholas Tinsley
2024-08-23 16:35:52 -04:00
parent 4354a9ff5e
commit 45833ef24a
2 changed files with 15 additions and 0 deletions

View File

@@ -529,6 +529,8 @@ class TransferControlView @JvmOverloads constructor(context: Context, attrs: Att
val existingEvent = mutableMap[attachment]
if (existingEvent == null || updateEvent.completed > existingEvent.completed) {
mutableMap[attachment] = updateEvent
} else if (updateEvent.completed < 0) {
mutableMap.remove(attachment)
}
verboseLog("onEventAsync compression update")
return@updateState it.copy(compressionProgress = mutableMap.toMap())
@@ -538,6 +540,8 @@ class TransferControlView @JvmOverloads constructor(context: Context, attrs: Att
val existingEvent = mutableMap[attachment]
if (existingEvent == null || updateEvent.completed > existingEvent.completed) {
mutableMap[attachment] = updateEvent
} else if (updateEvent.completed < 0) {
mutableMap.remove(attachment)
}
verboseLog("onEventAsync network update")
return@updateState it.copy(networkProgress = mutableMap.toMap())