mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
fix(apple): Restore favorites UI updates on iOS (#10908)
Recent refactors uncovered a latent bug where we never properly subscribed to favorites updates. The underlying data was being saved correctly to UserDefaults, but the view wouldn't redraw to reflect the change. The fix forwards Favourites.objectWillChange to Store.objectWillChange, matching the existing pattern for configuration changes and the pattern used by MenuBar on macOS. Relevant information: - Favourites is a nested ObservableObject inside Store - SwiftUI views observe Store via @EnvironmentObject - Nested ObservableObject changes don't automatically propagate through @Published properties Fixes #10906
This commit is contained in:
committed by
GitHub
parent
28f0dac50a
commit
f735855344
@@ -64,6 +64,13 @@ public final class Store: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
// Forward favourites changes to Store's objectWillChange so SwiftUI views observing Store get notified
|
||||
self.favorites.objectWillChange
|
||||
.sink { [weak self] _ in
|
||||
self?.objectWillChange.send()
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
// We monitor for any configuration changes and tell the tunnel service about them
|
||||
self.configuration.objectWillChange
|
||||
.receive(on: DispatchQueue.main)
|
||||
|
||||
Reference in New Issue
Block a user