Sfoglia il codice sorgente

update charts on UIApplication.willEnterForegroundNotification

Ivan Valkou 5 anni fa
parent
commit
236e50c459

+ 3 - 3
FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

@@ -238,6 +238,9 @@ struct MainChartView: View {
         .onChange(of: didAppearTrigger) { _ in
             update(fullSize: fullSize)
         }
+        .onReceive(Foundation.NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in
+            update(fullSize: fullSize)
+        }
     }
 
     private func bolusView(fullSize: CGSize) -> some View {
@@ -329,9 +332,6 @@ struct MainChartView: View {
         .onChange(of: suggestion) { _ in
             update(fullSize: fullSize)
         }
-        .onChange(of: didAppearTrigger) { _ in
-            update(fullSize: fullSize)
-        }
     }
 }