Prechádzať zdrojové kódy

Fix active bolus view being obscured and isSuspended race condition

Remove .ignoresSafeArea(.keyboard) from HomeRootView which could
intermittently cause the bottom content (active bolus/adjustment
views) to be laid out outside the visible area due to SwiftUI safe
area inset miscalculation.

Also, fixed a race condition in APSManager so that isSuspended is
always accessed from the main dispatch queue (it's accessed by the
UI).
Sam King 1 mesiac pred
rodič
commit
4ef32aaabf

+ 1 - 1
Trio/Sources/APS/APSManager.swift

@@ -197,7 +197,7 @@ final class BaseAPSManager: APSManager, Injectable {
             .store(in: &lifetime)
 
         deviceDataManager.suspended
-            .receive(on: processQueue)
+            .receive(on: DispatchQueue.main)
             .sink { suspended in
                 self.isSuspended = suspended
             }

+ 0 - 1
Trio/Sources/Modules/Home/View/HomeRootView.swift

@@ -1003,7 +1003,6 @@ extension Home {
             }
             .navigationTitle("Home")
             .navigationBarHidden(true)
-            .ignoresSafeArea(.keyboard)
             .blur(radius: state.isLoopStatusPresented ? 3 : 0)
             .sheet(isPresented: $state.isLoopStatusPresented) {
                 LoopStatusView(state: state)