android: correctly apply disable conditions to switch/abort switch buttons (#2726)

This commit is contained in:
spaced4ndy
2023-07-19 20:49:05 +04:00
committed by GitHub
parent 94e25d9bb4
commit f5612504f5

View File

@@ -495,7 +495,7 @@ fun SimplexServers(text: String, servers: List<String>) {
@Composable
fun SwitchAddressButton(disabled: Boolean, switchAddress: () -> Unit) {
SectionItemView(switchAddress) {
SectionItemView(switchAddress, disabled = disabled) {
Text(
stringResource(MR.strings.switch_receiving_address),
color = if (disabled) MaterialTheme.colors.secondary else MaterialTheme.colors.primary
@@ -505,7 +505,7 @@ fun SwitchAddressButton(disabled: Boolean, switchAddress: () -> Unit) {
@Composable
fun AbortSwitchAddressButton(disabled: Boolean, abortSwitchAddress: () -> Unit) {
SectionItemView(abortSwitchAddress) {
SectionItemView(abortSwitchAddress, disabled = disabled) {
Text(
stringResource(MR.strings.abort_switch_receiving_address),
color = if (disabled) MaterialTheme.colors.secondary else MaterialTheme.colors.primary