Browse Source

Fix Zoom unintentionally opening issue.

pull/101/head
Abhishek 4 years ago
parent
commit
c48ef18e99
  1. 16
      Clocker/Panel/ParentPanelController.swift

16
Clocker/Panel/ParentPanelController.swift

@ -696,19 +696,19 @@ class ParentPanelController: NSWindowController {
} }
@IBAction func dismissNextEventLabel(_: NSButton) { @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() removeUpcomingEventView()
}
} }
func removeUpcomingEventView() { func removeUpcomingEventView() {
OperationQueue.main.addOperation { 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 { if self.stackView.arrangedSubviews.contains(self.upcomingEventView!), self.upcomingEventView?.isHidden == false {
self.upcomingEventView?.isHidden = true self.upcomingEventView?.isHidden = true
UserDefaults.standard.set("NO", forKey: CLShowUpcomingEventView) UserDefaults.standard.set("NO", forKey: CLShowUpcomingEventView)

Loading…
Cancel
Save