From b1ecfd83042e2c68dac2dadbcb026517a72253a9 Mon Sep 17 00:00:00 2001 From: ChingCdesu <41897540+ChingCdesu@users.noreply.github.com> Date: Sun, 9 Jun 2024 19:18:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=B7=E7=90=86=E6=99=BA=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E6=97=B6=E6=9C=89=E6=A6=82=E7=8E=87=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/Main/AsstProxy.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/MaaWpfGui/Main/AsstProxy.cs b/src/MaaWpfGui/Main/AsstProxy.cs index aae7996703..ed7a292e23 100644 --- a/src/MaaWpfGui/Main/AsstProxy.cs +++ b/src/MaaWpfGui/Main/AsstProxy.cs @@ -771,12 +771,15 @@ namespace MaaWpfGui.Main DisposeTimer(); } - _toastNotificationTimer = new DispatcherTimer - { - Interval = recoveryTime - DateTimeOffset.Now.AddMinutes(6), - }; - _toastNotificationTimer.Tick += OnToastNotificationTimerTick; - _toastNotificationTimer.Start(); + var interval = recoveryTime - DateTimeOffset.Now.AddMinutes(6); + if (interval > 0) { + _toastNotificationTimer = new DispatcherTimer + { + Interval = interval, + }; + _toastNotificationTimer.Tick += OnToastNotificationTimerTick; + _toastNotificationTimer.Start(); + } } else {