From fce9f93df48e3e8c20d2ce01950912e1e4fb21bf Mon Sep 17 00:00:00 2001 From: Abdelilah El Aissaoui Date: Fri, 5 Nov 2021 04:33:07 +0100 Subject: [PATCH] Added diff closing to show the log after commiting --- src/main/kotlin/app/ui/RepositoryOpen.kt | 7 +++++-- src/main/kotlin/app/ui/UncommitedChanges.kt | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/app/ui/RepositoryOpen.kt b/src/main/kotlin/app/ui/RepositoryOpen.kt index 391224a..9d30ab6 100644 --- a/src/main/kotlin/app/ui/RepositoryOpen.kt +++ b/src/main/kotlin/app/ui/RepositoryOpen.kt @@ -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) diff --git a/src/main/kotlin/app/ui/UncommitedChanges.kt b/src/main/kotlin/app/ui/UncommitedChanges.kt index d26cfcb..f4e093a 100644 --- a/src/main/kotlin/app/ui/UncommitedChanges.kt +++ b/src/main/kotlin/app/ui/UncommitedChanges.kt @@ -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,