Browse Source

Make upcoming events source optional.

pull/113/head
Abhishek Banthia 3 years ago
parent
commit
2bc03f820b
  1. 6
      Clocker/Panel/ParentPanelController.swift

6
Clocker/Panel/ParentPanelController.swift

@ -89,7 +89,7 @@ class ParentPanelController: NSWindowController {
// Upcoming Events
@IBOutlet var upcomingEventCollectionView: NSCollectionView!
@IBOutlet var upcomingEventContainerView: NSView!
public var upcomingEventsDataSource: UpcomingEventsDataSource!
public var upcomingEventsDataSource: UpcomingEventsDataSource?
var defaultPreferences: [Data] {
return DataStore.shared().timezones()
@ -829,7 +829,7 @@ class ParentPanelController: NSWindowController {
if self.upcomingEventCollectionView != nil,
let upcomingEvents = eventCenter.upcomingEventsForDay(events)
{
self.upcomingEventsDataSource.updateEventsDataSource(upcomingEvents)
self.upcomingEventsDataSource?.updateEventsDataSource(upcomingEvents)
self.upcomingEventCollectionView.reloadData()
return
}
@ -840,7 +840,7 @@ class ParentPanelController: NSWindowController {
}
} else {
if upcomingEventCollectionView != nil {
upcomingEventsDataSource.updateEventsDataSource([])
upcomingEventsDataSource?.updateEventsDataSource([])
upcomingEventCollectionView.reloadData()
return
}

Loading…
Cancel
Save