mirror of
https://github.com/bitwarden/android.git
synced 2026-06-09 08:09:16 -05:00
Update the Send max access count logic (#557)
This commit is contained in:
committed by
Álison Fernandes
parent
27ddac59b9
commit
49411f3e2f
@@ -228,6 +228,7 @@ private fun AddSendOptions(
|
||||
value = state.common.maxAccessCount,
|
||||
onValueChange = addSendHandlers.onMaxAccessCountChange,
|
||||
isDecrementEnabled = state.common.maxAccessCount != null,
|
||||
range = 0..Int.MAX_VALUE,
|
||||
modifier = Modifier
|
||||
.padding(horizontal = 16.dp),
|
||||
)
|
||||
|
||||
@@ -261,7 +261,9 @@ class AddSendViewModel @Inject constructor(
|
||||
}
|
||||
|
||||
private fun handleMaxAccessCountChange(action: AddSendAction.MaxAccessCountChange) {
|
||||
updateCommonContent { it.copy(maxAccessCount = action.value) }
|
||||
updateCommonContent { common ->
|
||||
common.copy(maxAccessCount = action.value.takeUnless { it == 0 })
|
||||
}
|
||||
}
|
||||
|
||||
private inline fun onContent(
|
||||
@@ -355,7 +357,6 @@ data class AddSendState(
|
||||
@Parcelize
|
||||
data class Common(
|
||||
val name: String,
|
||||
// Null here means "not set"
|
||||
val maxAccessCount: Int?,
|
||||
val passwordInput: String,
|
||||
val noteInput: String,
|
||||
|
||||
Reference in New Issue
Block a user