Added diff closing to show the log after commiting

This commit is contained in:
Abdelilah El Aissaoui 2021-11-05 04:33:07 +01:00
parent d3633151f7
commit fce9f93df4
2 changed files with 7 additions and 3 deletions

View File

@ -125,7 +125,7 @@ fun RepositoryOpenPage(gitManager: GitManager, dialogManager: DialogManager) {
onCheckoutRef = { ref ->
gitManager.checkoutRef(ref)
},
onMergeBranch = { ref , fastForward ->
onMergeBranch = { ref, fastForward ->
gitManager.mergeBranch(ref, fastForward)
},
onRevCommitSelected = { commit ->
@ -157,7 +157,10 @@ fun RepositoryOpenPage(gitManager: GitManager, dialogManager: DialogManager) {
UncommitedChanges(
gitManager = gitManager,
onStagedDiffEntrySelected = { diffEntry ->
diffSelected = DiffEntryType.StagedDiff(diffEntry)
diffSelected = if (diffEntry != null)
DiffEntryType.StagedDiff(diffEntry)
else
null
},
onUnstagedDiffEntrySelected = { diffEntry ->
diffSelected = DiffEntryType.UnstagedDiff(diffEntry)

View File

@ -37,7 +37,7 @@ import app.theme.headerText
@Composable
fun UncommitedChanges(
gitManager: GitManager,
onStagedDiffEntrySelected: (DiffEntry) -> Unit,
onStagedDiffEntrySelected: (DiffEntry?) -> Unit,
onUnstagedDiffEntrySelected: (DiffEntry) -> Unit,
) {
val stageStatusState = gitManager.stageStatus.collectAsState()
@ -137,6 +137,7 @@ fun UncommitedChanges(
onClick = {
gitManager.commit(commitMessage)
commitMessage = ""
onStagedDiffEntrySelected(null)
},
enabled = commitMessage.isNotEmpty() && staged.isNotEmpty(),
shape = RectangleShape,