From ef38f2b3da662f8e49303f6d891f9cefdc1f05db Mon Sep 17 00:00:00 2001 From: Abhishek Banthia <8280282+n0shake@users.noreply.github.com> Date: Mon, 1 Jan 2024 15:59:04 -0500 Subject: [PATCH] Fix unresponsive slider when forward button tapped on the first occasion. See details for desc. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit More details in the original feedback: "The +15 doesn’t change the time when you click it the first time. For example, the minute was 21. I clicked +15, the scrollbar moved, but the time did not change to the 30th minute. I clicked it again, and it jumped to the 45th minute. Going backwards (-15) works on first click. It’s just the initial +15 click that doesn’t change the time." --- Clocker/Panel/ParentPanelController+ModernSlider.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Clocker/Panel/ParentPanelController+ModernSlider.swift b/Clocker/Panel/ParentPanelController+ModernSlider.swift index 8d6508f..fb37231 100644 --- a/Clocker/Panel/ParentPanelController+ModernSlider.swift +++ b/Clocker/Panel/ParentPanelController+ModernSlider.swift @@ -134,7 +134,7 @@ extension ParentPanelController { let futureSliderDayRange = (futureSliderDayPreference.intValue + 1) let totalCount = (PanelConstants.modernSliderPointsInADay * futureSliderDayRange * 2) + 1 let centerPoint = Int(ceil(Double(totalCount / 2))) - if index > (centerPoint + 1) { + if index >= (centerPoint + 1) { let remainder = (index % (centerPoint + 1)) let nextDate = Calendar.current.date(byAdding: .minute, value: remainder * 15, to: closestQuarterTimeRepresentation ?? Date())! modernSliderLabel.stringValue = timezoneFormattedStringRepresentation(nextDate)