From 8d9bd83d56870bd84623b4a0b44ae7e84b0f6ad7 Mon Sep 17 00:00:00 2001 From: Chanple Date: Thu, 14 Apr 2022 09:18:57 +0800 Subject: [PATCH] v1.4.3 --- Sources/SmartTaskbar.Win10/Worker/Engine.cs | 6 ++++-- Sources/SmartTaskbar/Worker/Engine.cs | 12 +++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Sources/SmartTaskbar.Win10/Worker/Engine.cs b/Sources/SmartTaskbar.Win10/Worker/Engine.cs index 7b83324..28a17f2 100644 --- a/Sources/SmartTaskbar.Win10/Worker/Engine.cs +++ b/Sources/SmartTaskbar.Win10/Worker/Engine.cs @@ -26,10 +26,12 @@ public Engine(Container container) private static async void Timer_Tick(object sender, EventArgs e) { + if (UserSettings.AutoModeType != AutoModeType.Auto) + return; + _timer.Stop(); - if (UserSettings.AutoModeType == AutoModeType.Auto) - await Task.Run(AutoModeWorker); + await Task.Run(AutoModeWorker); _timer.Start(); } diff --git a/Sources/SmartTaskbar/Worker/Engine.cs b/Sources/SmartTaskbar/Worker/Engine.cs index 7c4d63a..48f3950 100644 --- a/Sources/SmartTaskbar/Worker/Engine.cs +++ b/Sources/SmartTaskbar/Worker/Engine.cs @@ -21,10 +21,16 @@ public Engine(Container container) _timer.Start(); } - private static void Timer_Tick(object sender, EventArgs e) + private static async void Timer_Tick(object sender, EventArgs e) { - if (UserSettings.AutoModeType == AutoModeType.Auto) - Task.Run(AutoModeWorker); + if (UserSettings.AutoModeType != AutoModeType.Auto) + return; + + _timer.Stop(); + + await Task.Run(AutoModeWorker); + + _timer.Start(); } private static void AutoModeWorker()