Fixed commit msg not cleared after commit
This commit is contained in:
parent
48b51b3796
commit
7b1a79e2cf
@ -61,6 +61,11 @@ fun UncommitedChanges(
|
|||||||
}
|
}
|
||||||
|
|
||||||
var commitMessage by remember { mutableStateOf("") }
|
var commitMessage by remember { mutableStateOf("") }
|
||||||
|
val doCommit = {
|
||||||
|
gitManager.commit(commitMessage)
|
||||||
|
onStagedDiffEntrySelected(null)
|
||||||
|
commitMessage = ""
|
||||||
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
AnimatedVisibility(
|
AnimatedVisibility(
|
||||||
@ -132,7 +137,7 @@ fun UncommitedChanges(
|
|||||||
.weight(weight = 1f, fill = true)
|
.weight(weight = 1f, fill = true)
|
||||||
.onPreviewKeyEvent {
|
.onPreviewKeyEvent {
|
||||||
if (it.isCtrlPressed && it.key == Key.Enter) {
|
if (it.isCtrlPressed && it.key == Key.Enter) {
|
||||||
gitManager.commit(commitMessage)
|
doCommit()
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -150,9 +155,7 @@ fun UncommitedChanges(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth(),
|
.fillMaxWidth(),
|
||||||
onClick = {
|
onClick = {
|
||||||
gitManager.commit(commitMessage)
|
doCommit()
|
||||||
commitMessage = ""
|
|
||||||
onStagedDiffEntrySelected(null)
|
|
||||||
},
|
},
|
||||||
enabled = commitMessage.isNotEmpty() && staged.isNotEmpty(),
|
enabled = commitMessage.isNotEmpty() && staged.isNotEmpty(),
|
||||||
shape = RectangleShape,
|
shape = RectangleShape,
|
||||||
|
Loading…
Reference in New Issue
Block a user