improve code

This commit is contained in:
Conny Duck 2022-11-29 19:43:11 +01:00
parent 3d63596b0c
commit 478dd8c601
2 changed files with 2 additions and 1 deletions

View File

@ -145,7 +145,7 @@ class MediaUploader @Inject constructor(
*/
fun cancelUploadScope(vararg localMediaIds: Int) {
localMediaIds.forEach { localId ->
uploads[localId]?.scope?.cancel()
uploads.remove(localId)?.scope?.cancel()
}
}

View File

@ -144,6 +144,7 @@ class SendStatusService : Service(), Injectable {
is UploadEvent.ErrorEvent -> {
Log.w(TAG, "failed uploading media", uploadState.error)
failSending(statusId)
stopSelfWhenDone()
return@launch
}
}