From d4bcc60113f11dfa7768bb2b24d6ae265a87177f Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 4 Mar 2025 09:29:07 +0800 Subject: [PATCH] enhance: disable `CONTINUE` button while it is running (#1046) Signed-off-by: leo --- src/ViewModels/WorkingCopy.cs | 12 ++++++++++++ src/Views/WorkingCopy.axaml | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs index 97684093..35db11b9 100644 --- a/src/ViewModels/WorkingCopy.cs +++ b/src/ViewModels/WorkingCopy.cs @@ -440,6 +440,8 @@ namespace SourceGit.ViewModels public void ContinueMerge() { + IsCommitting = true; + if (_inProgressContext != null) { _repo.SetWatcherEnabled(false); @@ -456,17 +458,21 @@ namespace SourceGit.ViewModels CommitMessage = string.Empty; _repo.SetWatcherEnabled(true); + IsCommitting = false; }); }); } else { _repo.MarkWorkingCopyDirtyManually(); + IsCommitting = false; } } public void SkipMerge() { + IsCommitting = true; + if (_inProgressContext != null) { _repo.SetWatcherEnabled(false); @@ -479,17 +485,21 @@ namespace SourceGit.ViewModels CommitMessage = string.Empty; _repo.SetWatcherEnabled(true); + IsCommitting = false; }); }); } else { _repo.MarkWorkingCopyDirtyManually(); + IsCommitting = false; } } public void AbortMerge() { + IsCommitting = true; + if (_inProgressContext != null) { _repo.SetWatcherEnabled(false); @@ -502,12 +512,14 @@ namespace SourceGit.ViewModels CommitMessage = string.Empty; _repo.SetWatcherEnabled(true); + IsCommitting = false; }); }); } else { _repo.MarkWorkingCopyDirtyManually(); + IsCommitting = false; } } diff --git a/src/Views/WorkingCopy.axaml b/src/Views/WorkingCopy.axaml index ebf26a96..0120eda5 100644 --- a/src/Views/WorkingCopy.axaml +++ b/src/Views/WorkingCopy.axaml @@ -397,7 +397,8 @@ Width="0" Height="0" Background="Transparent" Command="{Binding CommitWithAutoStage}" - HotKey="{OnPlatform Ctrl+Shift+Enter, macOS=⌘+Shift+Enter}"/> + HotKey="{OnPlatform Ctrl+Shift+Enter, macOS=⌘+Shift+Enter}" + IsEnabled="{Binding !IsCommitting}"/>