mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
v2.1.12
This commit is contained in:
@@ -48,19 +48,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
os_log(.info, log: log, "Stats started in %.4f seconds", startingPoint.timeIntervalSinceNow * -1)
|
||||
}
|
||||
|
||||
func userNotificationCenter(_ center: NSUserNotificationCenter, didActivate notification: NSUserNotification) {
|
||||
if let uri = notification.userInfo?["url"] as? String {
|
||||
os_log(.debug, log: log, "Downloading new version of app...")
|
||||
if let url = URL(string: uri) {
|
||||
updater.download(url, doneHandler: { path in
|
||||
updater.install(path: path)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
NSUserNotificationCenter.default.removeDeliveredNotification(self.updateNotification)
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ aNotification: Notification) {
|
||||
modules.forEach{ $0.terminate() }
|
||||
_ = smc.close()
|
||||
@@ -76,6 +63,19 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
return true
|
||||
}
|
||||
|
||||
func userNotificationCenter(_ center: NSUserNotificationCenter, didActivate notification: NSUserNotification) {
|
||||
if let uri = notification.userInfo?["url"] as? String {
|
||||
os_log(.debug, log: log, "Downloading new version of app...")
|
||||
if let url = URL(string: uri) {
|
||||
updater.download(url, doneHandler: { path in
|
||||
updater.install(path: path)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
NSUserNotificationCenter.default.removeDeliveredNotification(self.updateNotification)
|
||||
}
|
||||
|
||||
@objc private func updateCron() {
|
||||
self.updateActivity.invalidate()
|
||||
self.updateActivity.repeats = true
|
||||
|
||||
Reference in New Issue
Block a user