ソースを参照

Revert "Early exit WatchManager initialization if no watch paired"

This reverts commit 7c38660e6edefd1c76cb3a4cf396de02e3accaab.
Deniz Cengiz 1 年間 前
コミット
ba8a206ce4
1 ファイル変更3 行追加13 行削除
  1. 3 13
      Trio/Sources/Services/WatchManager/AppleWatchManager.swift

+ 3 - 13
Trio/Sources/Services/WatchManager/AppleWatchManager.swift

@@ -45,9 +45,7 @@ final class BaseWatchManager: NSObject, WCSessionDelegate, Injectable, WatchMana
     init(resolver: Resolver) {
         super.init()
         injectServices(resolver)
-        guard setupWatchSession() else {
-            return
-        }
+        setupWatchSession()
 
         units = settingsManager.settings.units
         glucoseColorScheme = settingsManager.settings.glucoseColorScheme
@@ -125,24 +123,16 @@ final class BaseWatchManager: NSObject, WCSessionDelegate, Injectable, WatchMana
     }
 
     /// Sets up the WatchConnectivity session if the device supports it
-    private func setupWatchSession() -> Bool {
+    private func setupWatchSession() {
         if WCSession.isSupported() {
             let session = WCSession.default
             session.delegate = self
             session.activate()
             self.session = session
-            debug(.watchManager, "📱 Phone session setup - isPaired: \(session.isPaired)")
 
-            guard session.isPaired else {
-                debug(.watchManager, "⌚️❌ No Watch is paired")
-                // return here to end any further initialization of Apple Watch Manager
-                return false
-            }
-            return true
+            debug(.watchManager, "📱 Phone session setup - isPaired: \(session.isPaired)")
         } else {
             debug(.watchManager, "📱 WCSession is not supported on this device")
-            // return here to end any further initialization of Apple Watch Manager
-            return false
         }
     }