From 59ac7dc32467b7426b2cc67dd82703b1eb927dd5 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Sat, 13 Aug 2022 12:23:49 -0400 Subject: [PATCH] "Started +0s" => "Started" --- Clocker/Events and Reminders/CalendarHandler.swift | 2 +- Clocker/Preferences/Menu Bar/StatusItemHandler.swift | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Clocker/Events and Reminders/CalendarHandler.swift b/Clocker/Events and Reminders/CalendarHandler.swift index 4019ee4..ab124f7 100644 --- a/Clocker/Events and Reminders/CalendarHandler.swift +++ b/Clocker/Events and Reminders/CalendarHandler.swift @@ -448,7 +448,7 @@ struct EventInfo { func metadataForMeeting() -> String { let timeIntervalSinceNowForMeeting = event.startDate.timeIntervalSinceNow - if timeIntervalSinceNowForMeeting == 0 { + if timeIntervalSinceNowForMeeting == 0 || event.startDate.shortTimeAgoSinceNow == "0s" { return "started." } else if timeIntervalSinceNowForMeeting < 0, timeIntervalSinceNowForMeeting > -300 { return "started +\(event.startDate.shortTimeAgoSinceNow)." diff --git a/Clocker/Preferences/Menu Bar/StatusItemHandler.swift b/Clocker/Preferences/Menu Bar/StatusItemHandler.swift index d07f564..f6a8cfe 100644 --- a/Clocker/Preferences/Menu Bar/StatusItemHandler.swift +++ b/Clocker/Preferences/Menu Bar/StatusItemHandler.swift @@ -247,14 +247,17 @@ class StatusItemHandler: NSObject { func updateCompactMenubar() { let filteredEvents = EventCenter.sharedCenter().filteredEvents let calendar = EventCenter.sharedCenter().autoupdatingCalendar - if menubarTitleHandler.checkForUpcomingEvents(filteredEvents, calendar: calendar) != nil { + let upcomingEvent = menubarTitleHandler.checkForUpcomingEvents(filteredEvents, calendar: calendar) + if upcomingEvent != nil { // Iterate and see if we're showing the calendar item view let upcomingEventView = retrieveUpcomingEventStatusView() // If not, reconstruct Status Container View with another view if upcomingEventView == nil { constructCompactView(with: true) } - } else if let upcomingEventView = retrieveUpcomingEventStatusView() { + } + + if let upcomingEventView = retrieveUpcomingEventStatusView(), upcomingEvent == nil { upcomingEventView.removeFromSuperview() constructCompactView() // So that Status Container View reclaims the space }