From f735855344dc51efb7cf11cdf99ede5f57e3a785 Mon Sep 17 00:00:00 2001 From: Mariusz Klochowicz Date: Wed, 19 Nov 2025 02:03:57 +1100 Subject: [PATCH] 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 --- .../FirezoneKit/Sources/FirezoneKit/Stores/Store.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/swift/apple/FirezoneKit/Sources/FirezoneKit/Stores/Store.swift b/swift/apple/FirezoneKit/Sources/FirezoneKit/Stores/Store.swift index e1ef2796c..a431edb6c 100644 --- a/swift/apple/FirezoneKit/Sources/FirezoneKit/Stores/Store.swift +++ b/swift/apple/FirezoneKit/Sources/FirezoneKit/Stores/Store.swift @@ -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)