Explorar o código

Don't run in background

(cherry picked from commit f41a1e24b1b5d264e5ed17c463e96fce1b49c139)
Jon Mårtensson %!s(int64=3) %!d(string=hai) anos
pai
achega
bc2f8e2953
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      FreeAPS/Sources/APS/APSManager.swift

+ 2 - 2
FreeAPS/Sources/APS/APSManager.swift

@@ -247,8 +247,8 @@ final class BaseAPSManager: APSManager, Injectable {
 
         loopStats(loopStatRecord: loopStatRecord)
 
-        // Create a statistics.json
-        if settings.displayStatistics {
+        // Create a statistics.json. Don't run in backgound
+        if settings.displayStatistics, UIApplication.shared.applicationState != .background {
             statistics()
         }