Browse Source

Inline ubiquitousStoreDidChange.

pull/113/head
Abhishek Banthia 3 years ago
parent
commit
3c7dac9993
  1. 20
      Clocker/Panel/ParentPanelController.swift

20
Clocker/Panel/ParentPanelController.swift

@ -186,10 +186,14 @@ class ParentPanelController: NSWindowController {
selector: #selector(systemTimezoneDidChange),
name: NSNotification.Name.NSSystemTimeZoneDidChange,
object: nil)
NotificationCenter.default.addObserver(self,
selector: #selector(ubiquitousStoreDidChange),
name: NSUbiquitousKeyValueStore.didChangeExternallyNotification,
object: nil)
NotificationCenter.default.addObserver(forName: NSUbiquitousKeyValueStore.didChangeExternallyNotification,
object: self,
queue: OperationQueue.main) { [weak self] _ in
if let sSelf = self {
sSelf.mainTableView.reloadData()
sSelf.setScrollViewConstraint()
}
}
// Setup upcoming events view
upcomingEventContainerView.setAccessibility("UpcomingEventView")
@ -247,14 +251,6 @@ class ParentPanelController: NSWindowController {
}
}
// Backing defaults changed
@objc func ubiquitousStoreDidChange() {
OperationQueue.main.addOperation {
self.mainTableView.reloadData()
self.setScrollViewConstraint()
}
}
private func updateHomeObject(with customLabel: String, coordinates: CLLocationCoordinate2D?) {
let timezones = DataStore.shared().timezones()

Loading…
Cancel
Save