mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-09-20 03:10:57 +00:00
Fix disabled updater
This commit is contained in:
parent
deace4b378
commit
288c8f8eaa
@ -44,15 +44,15 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
}
|
||||
try? publicKeyFileStoreController.generatePublicKeys(for: storeList.allSecrets, clear: true)
|
||||
notifier.prompt()
|
||||
// _ = withObservationTracking {
|
||||
// updater.update
|
||||
// } onChange: { [updater, notifier] in
|
||||
// notifier.notify(update: updater.update!) { release in
|
||||
// Task {
|
||||
// await updater.ignore(release: release)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
_ = withObservationTracking {
|
||||
updater.update
|
||||
} onChange: { [updater, notifier] in
|
||||
Task {
|
||||
await notifier.notify(update: updater.update!) { release in
|
||||
await updater.ignore(release: release)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ final class Notifier: Sendable {
|
||||
try? await notificationCenter.add(request)
|
||||
}
|
||||
|
||||
func notify(update: Release, ignore: (@Sendable (Release) -> Void)?) async {
|
||||
func notify(update: Release, ignore: (@Sendable (Release) async -> Void)?) async {
|
||||
await notificationDelegate.state.prepareForNotification(release: update, ignoreAction: ignore)
|
||||
let notificationCenter = UNUserNotificationCenter.current()
|
||||
let notificationContent = UNMutableNotificationContent()
|
||||
@ -134,7 +134,7 @@ final class NotificationDelegate: NSObject, UNUserNotificationCenterDelegate, Se
|
||||
|
||||
fileprivate actor State {
|
||||
typealias PersistAction = (@Sendable (AnySecret, AnySecretStore, TimeInterval?) async -> Void)
|
||||
typealias IgnoreAction = (@Sendable (Release) -> Void)
|
||||
typealias IgnoreAction = (@Sendable (Release) async -> Void)
|
||||
fileprivate var release: Release?
|
||||
fileprivate var ignoreAction: IgnoreAction?
|
||||
fileprivate var persistAction: PersistAction?
|
||||
|
Loading…
Reference in New Issue
Block a user