Просмотр исходного кода

fix adjustments view not updating in phone app

polscm32 aka Marvout 1 год назад
Родитель
Сommit
b5df793c00
1 измененных файлов с 12 добавлено и 0 удалено
  1. 12 0
      Trio/Sources/Services/WatchManager/AppleWatchManager.swift

+ 12 - 0
Trio/Sources/Services/WatchManager/AppleWatchManager.swift

@@ -412,6 +412,12 @@ final class BaseWatchManager: NSObject, WCSessionDelegate, Injectable, WatchMana
                             guard context.hasChanges else { return }
                             try context.save()
                             print("📱 Successfully cancelled override")
+
+                            // Send notification to update Adjustments UI
+                            Foundation.NotificationCenter.default.post(
+                                name: .didUpdateOverrideConfiguration,
+                                object: nil
+                            )
                         } catch {
                             print("❌ Error cancelling override: \(error.localizedDescription)")
                         }
@@ -454,6 +460,12 @@ final class BaseWatchManager: NSObject, WCSessionDelegate, Injectable, WatchMana
                         guard context.hasChanges else { return }
                         try context.save()
                         print("📱 Successfully activated override: \(presetName)")
+
+                        // Send notification to update Adjustments UI
+                        Foundation.NotificationCenter.default.post(
+                            name: .didUpdateOverrideConfiguration,
+                            object: nil
+                        )
                     } catch {
                         print("❌ Error activating override: \(error.localizedDescription)")
                     }