diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewPresenter.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewPresenter.kt index 1ca48848a2..4ac8eecc5c 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewPresenter.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewPresenter.kt @@ -74,9 +74,8 @@ class AttachmentsPreviewPresenter @AssistedInject constructor( val userSentAttachment = remember { mutableStateOf(false) } val mediaUploadInfoState = remember { mutableStateOf>(AsyncData.Uninitialized) } - var prePropressingJob: Job? = null LaunchedEffect(Unit) { - prePropressingJob = preProcessAttachment( + preProcessAttachment( attachment, mediaUploadInfoState, ) @@ -116,7 +115,6 @@ class AttachmentsPreviewPresenter @AssistedInject constructor( AttachmentsPreviewEvents.Cancel -> { coroutineScope.cancel( attachment, - prePropressingJob, mediaUploadInfoState.value, sendActionState, ) @@ -178,7 +176,6 @@ class AttachmentsPreviewPresenter @AssistedInject constructor( private fun CoroutineScope.cancel( attachment: Attachment, - preProcessingJob: Job?, mediaUploadInfo: AsyncData, sendActionState: MutableState, ) = launch { @@ -186,7 +183,6 @@ class AttachmentsPreviewPresenter @AssistedInject constructor( when (attachment) { is Attachment.Media -> { temporaryUriDeleter.delete(attachment.localMedia.uri) - preProcessingJob?.cancel() mediaUploadInfo.dataOrNull()?.let { data -> cleanUp(data) }