From c67cdb931f4f649d775f2f3cd70523f5207c4d08 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 11 Oct 2024 17:37:34 +0800 Subject: [PATCH] enhance: stop switching workspace when one or more tasks are running in opened pages --- src/ViewModels/Launcher.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ViewModels/Launcher.cs b/src/ViewModels/Launcher.cs index 5abf50e8..dd618e41 100644 --- a/src/ViewModels/Launcher.cs +++ b/src/ViewModels/Launcher.cs @@ -465,6 +465,15 @@ namespace SourceGit.ViewModels private void SwitchWorkspace(Workspace to) { + foreach (var one in Pages) + { + if (one.IsInProgress()) + { + App.RaiseException(null, "You have unfinished task(s) in opened pages. Please wait!!!"); + return; + } + } + _ignoreIndexChange = true; var pref = Preference.Instance;