diff --git a/src/main/kotlin/app/ui/UncommitedChanges.kt b/src/main/kotlin/app/ui/UncommitedChanges.kt index 623599f..239255f 100644 --- a/src/main/kotlin/app/ui/UncommitedChanges.kt +++ b/src/main/kotlin/app/ui/UncommitedChanges.kt @@ -66,6 +66,7 @@ fun UncommitedChanges( onStagedDiffEntrySelected(null) commitMessage = "" } + val canCommit = commitMessage.isNotEmpty() && staged.isNotEmpty() Column { AnimatedVisibility( @@ -136,7 +137,7 @@ fun UncommitedChanges( .fillMaxWidth() .weight(weight = 1f, fill = true) .onPreviewKeyEvent { - if (it.isCtrlPressed && it.key == Key.Enter) { + if (it.isCtrlPressed && it.key == Key.Enter && canCommit) { doCommit() true } @@ -157,7 +158,7 @@ fun UncommitedChanges( onClick = { doCommit() }, - enabled = commitMessage.isNotEmpty() && staged.isNotEmpty(), + enabled = canCommit, shape = RectangleShape, ) { Text(