Fix NotificationCenter async sequence usage

Remove incorrect .values accessor - NotificationCenter.Notifications
is already an AsyncSequence
This commit is contained in:
Peter Steinberger 2025-06-17 03:43:20 +02:00
parent f7f5a9e29a
commit 8856916ccc

View file

@ -74,7 +74,8 @@ class ServerManager {
private func setupObservers() {
// Watch for server mode changes when the value actually changes
Task { @MainActor in
for await _ in NotificationCenter.default.notifications(named: UserDefaults.didChangeNotification).values {
let notifications = NotificationCenter.default.notifications(named: UserDefaults.didChangeNotification)
for await _ in notifications {
await handleServerModeChange()
}
}