Kaynağa Gözat

Change variable name for clarity, add time unit ('inMinutes')

Deniz Cengiz 2 gün önce
ebeveyn
işleme
6e91e54833
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      Trio Watch App Extension/WatchState.swift

+ 2 - 2
Trio Watch App Extension/WatchState.swift

@@ -65,7 +65,7 @@ import WatchConnectivity
     /// Snapshots older than this are dropped at the top of the WC delegate
     /// Snapshots older than this are dropped at the top of the WC delegate
     /// methods. Single source of truth for both `didReceiveMessage` and
     /// methods. Single source of truth for both `didReceiveMessage` and
     /// `didReceiveUserInfo`.
     /// `didReceiveUserInfo`.
-    private static let maxAcceptableMessageAge: TimeInterval = 15 * 60
+    private static let maxAcceptableMessageAgeInMinutes: TimeInterval = 15 * 60
 
 
     // MARK: - Debouncing and batch processing helpers
     // MARK: - Debouncing and batch processing helpers
 
 
@@ -236,7 +236,7 @@ import WatchConnectivity
         // Wall-clock staleness gate. Drops the queued backlog cheaply when
         // Wall-clock staleness gate. Drops the queued backlog cheaply when
         // the watch app wakes after long disuse; without it, every payload
         // the watch app wakes after long disuse; without it, every payload
         // schedules merge + UI work.
         // schedules merge + UI work.
-        guard date >= Date().addingTimeInterval(-Self.maxAcceptableMessageAge) else {
+        guard date >= Date().addingTimeInterval(-Self.maxAcceptableMessageAgeInMinutes) else {
             Task { await WatchLogger.shared.log("⌚️ Skipping stale watch state (\(date))") }
             Task { await WatchLogger.shared.log("⌚️ Skipping stale watch state (\(date))") }
             DispatchQueue.main.async { self.showSyncingAnimation = false }
             DispatchQueue.main.async { self.showSyncingAnimation = false }
             return
             return