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);