From 29736ef5cb51b051dbf5bbe055397f4a35c76940 Mon Sep 17 00:00:00 2001 From: Yuuko Shionji Date: Tue, 17 Oct 2023 22:07:15 +0200 Subject: [PATCH] Fixed timeout logic --- Logic/OSCTimer.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Logic/OSCTimer.cs b/Logic/OSCTimer.cs index 63b4688..83501b5 100644 --- a/Logic/OSCTimer.cs +++ b/Logic/OSCTimer.cs @@ -38,18 +38,11 @@ public static class OSCTimer { public static async Task OnIncParam(OscMessage message) { var shouldAdd = (bool)message.Arguments[0]; - if (input_delay > 0 & shouldAdd) { - if (DateTime.Now > lastAdded) { - Console.WriteLine($"Param recieved - Attempting to add {inc_step} minute(s)"); - lastAdded = DateTime.Now.AddMilliseconds(input_delay); - } - else { - ColorConsole.WithYellowText.WriteLine($"Restricted by input delay until: " + lastAdded); - } - } - else if (shouldAdd) { + if (shouldAdd) { Console.WriteLine($"Param recieved - Attempting to add {inc_step} seconds(s)"); - AddTime(inc_step); + if (input_delay > 0 && DateTime.Now < lastAdded) { + ColorConsole.WithYellowText.WriteLine($"Restricted by input delay until: " + lastAdded); + } else AddTime(inc_step); } }