diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/ImportFilesViewModel.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/ImportFilesViewModel.kt index 264b23edc..7461fe116 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/ImportFilesViewModel.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/ImportFilesViewModel.kt @@ -83,7 +83,7 @@ class ImportFilesViewModel @Inject constructor( isFirstViewModelCreation = false // Remove old imported files in case it would've crashed or similar to start with a clean slate. This is required // for already imported files restoration to not pick up old files in some extreme cases. - importationFilesManager.removeLocalCopyFolder() + removeOldData() } else { importationFilesManager.restoreAlreadyImportedFiles() } @@ -124,6 +124,11 @@ class ImportFilesViewModel @Inject constructor( } } + private suspend fun removeOldData() { + importationFilesManager.removeLocalCopyFolder() + uploadManager.removeAllUploadSession() + } + private fun generateNewUploadSession(): NewUploadSession { return NewUploadSession( duration = "30", diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5ac4e109d..468b62c07 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -20,7 +20,7 @@ qrose = "1.0.1" recaptcha = "18.6.1" sentry = "4.12.0" serialization = "1.7.1" -swisstransfer = "0.7.0" +swisstransfer = "0.7.2" workmanager = "2.9.1" [libraries]