From 6d5796e8391fda49759ddea00dc44cd68c4eb3c6 Mon Sep 17 00:00:00 2001 From: zzyyyl Date: Thu, 27 Oct 2022 20:02:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BB=A7=E7=BB=AD=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=81=9C=E6=AD=A2=E6=8C=89=E9=92=AE=E6=9C=89=E6=97=B6=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MeoAsstGui/ViewModels/TaskQueueViewModel.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/MeoAsstGui/ViewModels/TaskQueueViewModel.cs b/src/MeoAsstGui/ViewModels/TaskQueueViewModel.cs index 64c89f7b83..9a407f1ba3 100644 --- a/src/MeoAsstGui/ViewModels/TaskQueueViewModel.cs +++ b/src/MeoAsstGui/ViewModels/TaskQueueViewModel.cs @@ -635,8 +635,9 @@ namespace MeoAsstGui bool caught = await task; // 一般是点了“停止”按钮了 - if (Idle) + if (Stopping) { + SetStopped(); return; } @@ -664,8 +665,9 @@ namespace MeoAsstGui } // 一般是点了“停止”按钮了 - if (Idle) + if (Stopping) { + SetStopped(); return; } @@ -729,8 +731,9 @@ namespace MeoAsstGui } // 一般是点了“停止”按钮了 - if (Idle) + if (Stopping) { + SetStopped(); return; } @@ -751,7 +754,6 @@ namespace MeoAsstGui /// public async void Stop() { - Idle = true; Stopping = true; AddLog(Localization.GetString("Stopping")); var task = Task.Run(() => @@ -759,14 +761,15 @@ namespace MeoAsstGui return _container.Get().AsstStop(); }); await task; - SetStopped(); } public void SetStopped() { - if (!Idle || Stopping) { + if (!Idle || Stopping) + { AddLog(Localization.GetString("Stopped")); } + Stopping = false; Idle = true; }