Skip to content

Commit

Permalink
refactor: Rename SendStatus.Default into SendStatus.Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarX committed Dec 20, 2024
1 parent efdc5b7 commit 38a8dd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>(SendStatus.Default)
private val _sendStatus = MutableStateFlow<SendStatus>(SendStatus.Initial)
val sendStatus = _sendStatus.asStateFlow()

suspend fun sendNewTransfer(newUploadSession: NewUploadSession) {
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ private fun SendButton(
}

private fun SendStatus.canEnableButton(): Boolean = when (this) {
SendStatus.Default,
SendStatus.Initial,
SendStatus.Refused -> true
else -> false
}
Expand Down Expand Up @@ -478,7 +478,7 @@ private fun Preview(@PreviewParameter(FileUiListPreviewParameter::class) files:
addFiles = {},
closeActivity = {},
shouldStartByPromptingUserForFiles = false,
sendStatus = { SendStatus.Default },
sendStatus = { SendStatus.Initial },
sendTransfer = {},
)
}
Expand Down

0 comments on commit 38a8dd4

Please sign in to comment.