From c48ef18e99df0174fa970818677f87b4eb2eb5cf Mon Sep 17 00:00:00 2001 From: Abhishek Date: Tue, 6 Jul 2021 17:12:08 -0400 Subject: [PATCH] Fix Zoom unintentionally opening issue. --- Clocker/Panel/ParentPanelController.swift | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Clocker/Panel/ParentPanelController.swift b/Clocker/Panel/ParentPanelController.swift index 35bdc560..a740312d 100644 --- a/Clocker/Panel/ParentPanelController.swift +++ b/Clocker/Panel/ParentPanelController.swift @@ -696,19 +696,19 @@ class ParentPanelController: NSWindowController { } @IBAction func dismissNextEventLabel(_: NSButton) { + let eventCenter = EventCenter.sharedCenter() + let now = Date() + if let events = eventCenter.eventsForDate[NSCalendar.autoupdatingCurrent.startOfDay(for: now)], events.isEmpty == false { + if let upcomingEvent = eventCenter.nextOccuring(events), let meetingLink = upcomingEvent.meetingURL { + NSWorkspace.shared.open(meetingLink) + } + } else { removeUpcomingEventView() + } } func removeUpcomingEventView() { OperationQueue.main.addOperation { - let eventCenter = EventCenter.sharedCenter() - let now = Date() - if let events = eventCenter.eventsForDate[NSCalendar.autoupdatingCurrent.startOfDay(for: now)], events.isEmpty == false { - if let upcomingEvent = eventCenter.nextOccuring(events), let meetingLink = upcomingEvent.meetingURL { - NSWorkspace.shared.open(meetingLink) - } - } - if self.stackView.arrangedSubviews.contains(self.upcomingEventView!), self.upcomingEventView?.isHidden == false { self.upcomingEventView?.isHidden = true UserDefaults.standard.set("NO", forKey: CLShowUpcomingEventView)