Skip to content

Commit

Permalink
Move UploadStatus hard-coded parameter to its correct spot
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Sep 2, 2024
1 parent 283882a commit a7b5f19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ class Attachment : EmbeddedRealmObject, Attachable {
* After uploading an Attachment, we replace the local version with the remote one.
* The remote one doesn't know about local data, so we have to backup them.
*/
fun backupLocalData(oldAttachment: Attachment, uploadStatus: UploadStatus, draft: Draft) {
fun backupLocalData(oldAttachment: Attachment, draft: Draft) {
localUuid = oldAttachment.localUuid
uploadLocalUri = oldAttachment.uploadLocalUri
setUploadStatus(uploadStatus, draft, "backupLocalData -> setUploadStatus")
setUploadStatus(UploadStatus.FINISHED, draft, "backupLocalData -> setUploadStatus")
}

fun setUploadStatus(uploadStatus: UploadStatus, draft: Draft? = null, step: String = "") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import com.infomaniak.mail.R
import com.infomaniak.mail.data.api.ApiRoutes
import com.infomaniak.mail.data.cache.mailboxContent.DraftController
import com.infomaniak.mail.data.models.Attachment
import com.infomaniak.mail.data.models.Attachment.UploadStatus
import com.infomaniak.mail.data.models.mailbox.Mailbox
import com.infomaniak.mail.ui.main.SnackbarManager
import com.infomaniak.mail.ui.main.thread.actions.DownloadAttachmentProgressDialogArgs
Expand Down Expand Up @@ -191,7 +190,7 @@ object AttachmentExtensions {
SentryLog.d(ATTACHMENT_TAG, "When removing uploaded attachment, we found (uuids to localUris): $uuidToLocalUri")
SentryLog.d(ATTACHMENT_TAG, "Target uploadLocalUri is: $uploadLocalUri")

remoteAttachment.backupLocalData(oldAttachment = this@updateLocalAttachment, UploadStatus.FINISHED, draft)
remoteAttachment.backupLocalData(oldAttachment = this@updateLocalAttachment, draft)

SentryLog.d(ATTACHMENT_TAG, "Uploaded attachment uuid: ${remoteAttachment.uuid}")
SentryLog.d(ATTACHMENT_TAG, "Uploaded attachment localUuid: ${remoteAttachment.localUuid}")
Expand Down

0 comments on commit a7b5f19

Please sign in to comment.