From 67be0a93103176a61ab292167c6d404381ebc0f7 Mon Sep 17 00:00:00 2001 From: KrugarValdes Date: Fri, 25 Jul 2025 18:19:57 +0600 Subject: [PATCH 1/2] fix: Prevent event duration below 15 minutes to avoid crash --- .../effective/office/tablet/core/ui/common/EventDurationView.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/clients/tablet/core/ui/src/commonMain/kotlin/band/effective/office/tablet/core/ui/common/EventDurationView.kt b/clients/tablet/core/ui/src/commonMain/kotlin/band/effective/office/tablet/core/ui/common/EventDurationView.kt index 994efdab..0b10dd4e 100644 --- a/clients/tablet/core/ui/src/commonMain/kotlin/band/effective/office/tablet/core/ui/common/EventDurationView.kt +++ b/clients/tablet/core/ui/src/commonMain/kotlin/band/effective/office/tablet/core/ui/common/EventDurationView.kt @@ -52,6 +52,7 @@ fun EventDurationView( Button( modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), onClick = { decrement() }, + enabled = currentDuration > 15, colors = ButtonDefaults.buttonColors( containerColor = LocalCustomColorsPalette.current.elevationBackground ) -- GitLab From df44cc91e95ac2c428f07a8cf02880a9dd545e49 Mon Sep 17 00:00:00 2001 From: KrugarValdes Date: Mon, 28 Jul 2025 15:29:19 +0600 Subject: [PATCH 2/2] fix: Move minimum event duration to constant --- .../office/tablet/core/ui/common/EventDurationView.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clients/tablet/core/ui/src/commonMain/kotlin/band/effective/office/tablet/core/ui/common/EventDurationView.kt b/clients/tablet/core/ui/src/commonMain/kotlin/band/effective/office/tablet/core/ui/common/EventDurationView.kt index 0b10dd4e..fcabd888 100644 --- a/clients/tablet/core/ui/src/commonMain/kotlin/band/effective/office/tablet/core/ui/common/EventDurationView.kt +++ b/clients/tablet/core/ui/src/commonMain/kotlin/band/effective/office/tablet/core/ui/common/EventDurationView.kt @@ -30,6 +30,8 @@ import band.effective.office.tablet.core.ui.theme.h6 import band.effective.office.tablet.core.ui.theme.h8 import org.jetbrains.compose.resources.stringResource +private const val MIN_EVENT_DURATION_MINUTES = 15 + @Composable fun EventDurationView( modifier: Modifier = Modifier, @@ -52,7 +54,7 @@ fun EventDurationView( Button( modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), onClick = { decrement() }, - enabled = currentDuration > 15, + enabled = currentDuration > MIN_EVENT_DURATION_MINUTES, colors = ButtonDefaults.buttonColors( containerColor = LocalCustomColorsPalette.current.elevationBackground ) -- GitLab