diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/TransferSendManager.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/TransferSendManager.kt index d3f32ec78..b86603db7 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/TransferSendManager.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/TransferSendManager.kt @@ -45,7 +45,7 @@ class TransferSendManager @Inject constructor( ) { // TODO: Merge these two UI states in a single one for the whole flow of logic - private val _sendStatus = MutableStateFlow(SendStatus.Default) + private val _sendStatus = MutableStateFlow(SendStatus.Initial) val sendStatus = _sendStatus.asStateFlow() suspend fun sendNewTransfer(newUploadSession: NewUploadSession) { @@ -151,11 +151,11 @@ class TransferSendManager @Inject constructor( //endregion fun resetSendStatus() { - _sendStatus.value = SendStatus.Default + _sendStatus.value = SendStatus.Initial } sealed class SendStatus { - data object Default : SendStatus() + data object Initial : SendStatus() data object Pending : SendStatus() data class Success(val totalSize: Long) : SendStatus() data object Refused : SendStatus() diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ImportFilesScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ImportFilesScreen.kt index 7cf2c74e6..5be03e4c9 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ImportFilesScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/ImportFilesScreen.kt @@ -411,7 +411,7 @@ private fun SendButton( } private fun SendStatus.canEnableButton(): Boolean = when (this) { - SendStatus.Default, + SendStatus.Initial, SendStatus.Refused -> true else -> false } @@ -478,7 +478,7 @@ private fun Preview(@PreviewParameter(FileUiListPreviewParameter::class) files: addFiles = {}, closeActivity = {}, shouldStartByPromptingUserForFiles = false, - sendStatus = { SendStatus.Default }, + sendStatus = { SendStatus.Initial }, sendTransfer = {}, ) }