mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 05:31:21 +03:00
only deleting voice files if they were successfully uploading
- fixes flaky networks losing the voice file and being unable to retry
This commit is contained in:
parent
c72dd5eec6
commit
bdf9402685
1 changed files with 5 additions and 5 deletions
|
@ -279,6 +279,11 @@ internal class UploadContentWorker(val context: Context, params: WorkerParameter
|
|||
Timber.e(failure, "## Failed to update file cache")
|
||||
}
|
||||
|
||||
// Delete the temporary voice message file
|
||||
if (params.attachment.type == ContentAttachmentData.Type.AUDIO && params.attachment.mimeType == MimeTypes.Ogg) {
|
||||
context.contentResolver.delete(params.attachment.queryUri, null, null)
|
||||
}
|
||||
|
||||
val uploadThumbnailResult = dealWithThumbnail(params)
|
||||
|
||||
handleSuccess(params,
|
||||
|
@ -299,11 +304,6 @@ internal class UploadContentWorker(val context: Context, params: WorkerParameter
|
|||
filesToDelete.forEach {
|
||||
tryOrNull { it.delete() }
|
||||
}
|
||||
|
||||
// Delete the temporary voice message file
|
||||
if (params.attachment.type == ContentAttachmentData.Type.AUDIO && params.attachment.mimeType == MimeTypes.Ogg) {
|
||||
context.contentResolver.delete(params.attachment.queryUri, null, null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue