Не подтверждена Коммит ec95104d создал по автору Vitaly.Smirnov's avatar Vitaly.Smirnov Зафиксировано автором GitHub
Просмотр файлов

fix: Prevent event duration below 15 minutes to avoid crash (#349)

* fix: Prevent event duration below 15 minutes to avoid crash

* fix: Move minimum event duration to constant
владелец 3d68cb91
...@@ -30,6 +30,8 @@ import band.effective.office.tablet.core.ui.theme.h6 ...@@ -30,6 +30,8 @@ import band.effective.office.tablet.core.ui.theme.h6
import band.effective.office.tablet.core.ui.theme.h8 import band.effective.office.tablet.core.ui.theme.h8
import org.jetbrains.compose.resources.stringResource import org.jetbrains.compose.resources.stringResource
private const val MIN_EVENT_DURATION_MINUTES = 15
@Composable @Composable
fun EventDurationView( fun EventDurationView(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
...@@ -52,6 +54,7 @@ fun EventDurationView( ...@@ -52,6 +54,7 @@ fun EventDurationView(
Button( Button(
modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)),
onClick = { decrement() }, onClick = { decrement() },
enabled = currentDuration > MIN_EVENT_DURATION_MINUTES,
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
containerColor = LocalCustomColorsPalette.current.elevationBackground containerColor = LocalCustomColorsPalette.current.elevationBackground
) )
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать