Преглед изворни кода

Remove core data fetch limits (already time predicate limited)

dnzxy пре 1 недеља
родитељ
комит
8fc5e86269

+ 0 - 3
Trio/Sources/APS/APSManager.swift

@@ -1050,17 +1050,14 @@ final class BaseAPSManager: APSManager, Injectable {
             let glucose24h = try await fetchGlucose(predicate: NSPredicate.predicateForOneDayAgo, fetchLimit: 288, batchSize: 50)
             let glucoseOneWeek = try await fetchGlucose(
                 predicate: NSPredicate.predicateForOneWeek,
-                fetchLimit: 288 * 7,
                 batchSize: 250
             )
             let glucoseOneMonth = try await fetchGlucose(
                 predicate: NSPredicate.predicateForOneMonth,
-                fetchLimit: 288 * 7 * 30,
                 batchSize: 500
             )
             let glucoseThreeMonths = try await fetchGlucose(
                 predicate: NSPredicate.predicateForThreeMonths,
-                fetchLimit: 288 * 7 * 30 * 3,
                 batchSize: 1000
             )
 

+ 1 - 2
Trio/Sources/APS/Storage/PumpHistoryStorage.swift

@@ -274,8 +274,7 @@ final class BasePumpHistoryStorage: PumpHistoryStorage, Injectable {
             onContext: context,
             predicate: NSPredicate.pumpHistoryLast24h,
             key: "timestamp",
-            ascending: false,
-            fetchLimit: 288
+            ascending: false
         )
 
         return await context.perform {

+ 2 - 2
Trio/Sources/Localizations/Main/Localizable.xcstrings

@@ -81698,7 +81698,7 @@
       }
     },
     "d" : {
-      "comment" : "abbreviation for days",
+      "comment" : "Abbreviation for Days\nabbreviation for days",
       "localizations" : {
         "bg" : {
           "stringUnit" : {
@@ -132776,7 +132776,7 @@
       }
     },
     "h" : {
-      "comment" : "abbreviation for hours\nh",
+      "comment" : "Abbreviation for Hours\nabbreviation for hours\nh",
       "localizations" : {
         "bg" : {
           "stringUnit" : {

+ 11 - 11
Trio/Sources/Modules/Home/View/HomeRootView.swift

@@ -139,18 +139,18 @@ extension Home {
                 cgmSensorExpiresAt: state.cgmSensorExpiresAt,
                 cgmWarmupEndsAt: state.cgmWarmupEndsAt
             )
-                .onTapGesture {
-                    if !state.cgmAvailable {
-                        showCGMSelection.toggle()
-                    } else {
-                        state.shouldDisplayCGMSetupSheet.toggle()
-                    }
-                }
-                .onLongPressGesture {
-                    let impactHeavy = UIImpactFeedbackGenerator(style: .heavy)
-                    impactHeavy.impactOccurred()
-                    state.showModal(for: .snooze)
+            .onTapGesture {
+                if !state.cgmAvailable {
+                    showCGMSelection.toggle()
+                } else {
+                    state.shouldDisplayCGMSetupSheet.toggle()
                 }
+            }
+            .onLongPressGesture {
+                let impactHeavy = UIImpactFeedbackGenerator(style: .heavy)
+                impactHeavy.impactOccurred()
+                state.showModal(for: .snooze)
+            }
         }
 
         var pumpView: some View {

+ 1 - 2
Trio/Sources/Services/BolusCalculator/BolusCalculationManager.swift

@@ -196,8 +196,7 @@ final class BaseBolusCalculationManager: BolusCalculationManager, Injectable {
             onContext: glucoseFetchContext,
             predicate: NSPredicate.glucose,
             key: "date",
-            ascending: false,
-            fetchLimit: 288
+            ascending: false
         )
 
         return try await glucoseFetchContext.perform {

+ 1 - 2
Trio/Sources/Services/LiveActivity/Data/DataManager.swift

@@ -11,8 +11,7 @@ extension LiveActivityManager {
             onContext: context,
             predicate: NSPredicate.predicateForSixHoursAgo,
             key: "date",
-            ascending: false,
-            fetchLimit: 72
+            ascending: false
         )
 
         return try await context.perform {

+ 1 - 2
Trio/Sources/Services/WatchManager/AppleWatchManager.swift

@@ -379,8 +379,7 @@ final class BaseWatchManager: NSObject, WCSessionDelegate, Injectable, WatchMana
             onContext: backgroundContext,
             predicate: NSPredicate.glucose,
             key: "date",
-            ascending: false,
-            fetchLimit: 288
+            ascending: false
         )
 
         return try await backgroundContext.perform {