Explorar el Código

Don't run in background

Jon Mårtensson hace 3 años
padre
commit
f41a1e24b1
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      FreeAPS/Sources/APS/APSManager.swift

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

@@ -239,8 +239,8 @@ final class BaseAPSManager: APSManager, Injectable {
 
 
         loopStats(loopStatRecord: loopStatRecord)
         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()
             statistics()
         }
         }