Skip to content

Commit

Permalink
Fix Zoom unintentionally opening issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
n0shake committed Jul 6, 2021
1 parent b4359e3 commit c48ef18
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Clocker/Panel/ParentPanelController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c48ef18

Please sign in to comment.