mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
feat: hide the notification about the new version installed automatically after 10 seconds
This commit is contained in:
@@ -74,16 +74,22 @@ extension AppDelegate {
|
||||
let subtitle: String = localizedString("Stats was updated to v", currentVersion)
|
||||
|
||||
if #available(macOS 10.14, *) {
|
||||
_ = showNotification(
|
||||
let id = showNotification(
|
||||
title: title,
|
||||
subtitle: subtitle,
|
||||
delegate: self
|
||||
)
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 10) {
|
||||
removeNotification(id)
|
||||
}
|
||||
} else {
|
||||
_ = showNSNotification(
|
||||
let id = showNSNotification(
|
||||
title: title,
|
||||
subtitle: subtitle
|
||||
)
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 10) {
|
||||
removeNSNotification(id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user