Просмотр исходного кода

Fix overlaying of progress when acknowledge is active

Deniz Cengiz 1 год назад
Родитель
Сommit
e4d6479fb8

+ 2 - 2
Trio Watch App Extension/Views/BolusConfirmationView.swift

@@ -98,9 +98,9 @@ struct BolusConfirmationView: View {
                     .foregroundStyle(Color.white)
             }
         }
-        .blur(radius: state.bolusProgress > 0 && state.bolusProgress < 1.0 && !state.isBolusCanceled ? 3 : 0)
+        .blur(radius: state.showBolusProgressOverlay ? 3 : 0)
         .overlay {
-            if state.bolusProgress > 0 && state.bolusProgress < 1.0 && !state.isBolusCanceled && !state.showAcknowledgmentBanner {
+            if state.showBolusProgressOverlay {
                 BolusProgressOverlay(state: state)
                     .transition(.opacity)
             }

+ 2 - 2
Trio Watch App Extension/Views/BolusInputView.swift

@@ -136,9 +136,9 @@ struct BolusInputView: View {
                     .clipShape(Circle())
             }
         }
-        .blur(radius: state.bolusProgress > 0 && state.bolusProgress < 1.0 && !state.isBolusCanceled ? 3 : 0)
+        .blur(radius: state.showBolusProgressOverlay ? 3 : 0)
         .overlay {
-            if state.bolusProgress > 0 && state.bolusProgress < 1.0 && !state.isBolusCanceled {
+            if state.showBolusProgressOverlay {
                 BolusProgressOverlay(state: state)
                     .transition(.opacity)
             }

+ 2 - 2
Trio Watch App Extension/Views/TrioMainWatchView.swift

@@ -141,9 +141,9 @@ struct TrioMainWatchView: View {
                 }
             }
         }
-        .blur(radius: state.bolusProgress > 0 && state.bolusProgress < 1.0 && !state.isBolusCanceled ? 3 : 0)
+        .blur(radius: state.showBolusProgressOverlay ? 3 : 0)
         .overlay {
-            if state.bolusProgress > 0 && state.bolusProgress < 1.0 && !state.isBolusCanceled {
+            if state.showBolusProgressOverlay {
                 BolusProgressOverlay(state: state)
                     .transition(.opacity)
             }

+ 5 - 0
Trio Watch App Extension/WatchState.swift

@@ -50,6 +50,11 @@ import WatchConnectivity
     var mealBolusStep: MealBolusStep = .savingCarbs
     var isMealBolusCombo: Bool = false
 
+    var showBolusProgressOverlay: Bool {
+        (!showAcknowledgmentBanner || !showCommsAnimation || !showCommsAnimation) && bolusProgress > 0 && bolusProgress < 1.0 &&
+            !isBolusCanceled
+    }
+
     override init() {
         super.init()
         setupSession()