mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-06 01:02:20 +00:00
Hide set button when disabled
This commit is contained in:
@@ -67,7 +67,7 @@ fun DisappearingMessages(
|
||||
}
|
||||
}
|
||||
|
||||
OutlineButton(
|
||||
if (state.showSetButton) OutlineButton(
|
||||
stringResource(R.string.expiration_settings_set_button_title),
|
||||
modifier = Modifier
|
||||
.align(Alignment.CenterHorizontally)
|
||||
|
||||
@@ -182,17 +182,27 @@ class ExpirationSettingsViewModel(
|
||||
|
||||
data class UiState(
|
||||
val cards: List<CardModel> = emptyList(),
|
||||
val showGroupFooter: Boolean = false
|
||||
val showGroupFooter: Boolean = false,
|
||||
val showSetButton: Boolean = true
|
||||
) {
|
||||
constructor(state: State): this(
|
||||
cards = listOfNotNull(
|
||||
typeOptions(state)?.let { CardModel(GetString(R.string.activity_expiration_settings_delete_type), it) },
|
||||
timeOptions(state)?.let { CardModel(GetString(R.string.activity_expiration_settings_timer), it) }
|
||||
),
|
||||
showGroupFooter = state.isGroup && state.isNewConfigEnabled
|
||||
showGroupFooter = state.isGroup && state.isNewConfigEnabled,
|
||||
showSetButton = state.isSelfAdmin
|
||||
)
|
||||
|
||||
constructor(showGroupFooter: Boolean, vararg cards: CardModel): this(cards.asList(), showGroupFooter)
|
||||
constructor(
|
||||
vararg cards: CardModel,
|
||||
showGroupFooter: Boolean = false,
|
||||
showSetButton: Boolean = true,
|
||||
): this(
|
||||
cards.asList(),
|
||||
showGroupFooter,
|
||||
showSetButton
|
||||
)
|
||||
}
|
||||
|
||||
data class CardModel(
|
||||
|
||||
Reference in New Issue
Block a user