From b577126eaf142b3b327b43ac63c87bb48b7b092a Mon Sep 17 00:00:00 2001 From: uye <2396806385@qq.com> Date: Tue, 20 Dec 2022 16:42:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=85=B3=E5=8D=A1?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=90=8E=E5=AF=BC=E8=88=AA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix #3117 --- src/MaaWpfGui/Main/TaskQueueViewModel.cs | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/MaaWpfGui/Main/TaskQueueViewModel.cs b/src/MaaWpfGui/Main/TaskQueueViewModel.cs index 09dc36416d..65bec8a772 100644 --- a/src/MaaWpfGui/Main/TaskQueueViewModel.cs +++ b/src/MaaWpfGui/Main/TaskQueueViewModel.cs @@ -16,6 +16,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; +using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; @@ -285,17 +286,17 @@ namespace MaaWpfGui StageList = new ObservableCollection(_stageManager.GetStageList()); // reset closed stages to "Last/Current" - if (!CustomStageCode && (stage1 == null)) + if (!CustomStageCode && !StageList.Any(x => x.Value == stage1)) { Stage1 = string.Empty; } - if (stage2 == null) + if (!CustomStageCode && !StageList.Any(x => x.Value == stage2)) { Stage2 = string.Empty; } - if (stage3 == null) + if (!CustomStageCode && !StageList.Any(x => x.Value == stage3)) { Stage3 = string.Empty; } @@ -305,6 +306,11 @@ namespace MaaWpfGui // do nothing } } + + if (!CustomStageCode && !RemainingSanityStageList.Any(x => x.Value == _remainingSanityStage)) + { + RemainingSanityStage = string.Empty; + } } private bool NeedToUpdateDatePrompt() @@ -1450,7 +1456,16 @@ namespace MaaWpfGui public string RemainingSanityStage { - get => _remainingSanityStage; + get + { + if (!IsStageOpen(_remainingSanityStage)) + { + return string.Empty; + } + + return _remainingSanityStage; + } + set { SetAndNotify(ref _remainingSanityStage, value);