mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-05-22 03:00:55 +00:00
fix(menubar): Swift 6 strict concurrency for wake observers
Some checks are pending
CI / semgrep (push) Waiting to run
Some checks are pending
CI / semgrep (push) Waiting to run
This commit is contained in:
parent
48d2373fcc
commit
17b7e6ae6c
1 changed files with 3 additions and 5 deletions
|
|
@ -52,27 +52,25 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSPopoverDelegate {
|
|||
}
|
||||
|
||||
private func setupWakeObservers() {
|
||||
// Force refresh when system wakes from sleep
|
||||
NSWorkspace.shared.notificationCenter.addObserver(
|
||||
forName: NSWorkspace.didWakeNotification,
|
||||
object: nil,
|
||||
queue: .main
|
||||
) { [weak self] _ in
|
||||
self?.forceRefresh()
|
||||
Task { @MainActor in self?.forceRefresh() }
|
||||
}
|
||||
|
||||
// Force refresh when screen wakes
|
||||
NSWorkspace.shared.notificationCenter.addObserver(
|
||||
forName: NSWorkspace.screensDidWakeNotification,
|
||||
object: nil,
|
||||
queue: .main
|
||||
) { [weak self] _ in
|
||||
self?.forceRefresh()
|
||||
Task { @MainActor in self?.forceRefresh() }
|
||||
}
|
||||
}
|
||||
|
||||
private func forceRefresh() {
|
||||
Task { @MainActor in
|
||||
Task {
|
||||
await store.refreshQuietly(period: .today)
|
||||
refreshStatusButton()
|
||||
await store.refresh(includeOptimize: true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue