瀏覽代碼

Only show BLE permission alert when not yet authorized

Deniz Cengiz 1 年之前
父節點
當前提交
526cf15806
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      Trio/Sources/Modules/Onboarding/View/OnboardingRootView.swift

+ 7 - 1
Trio/Sources/Modules/Onboarding/View/OnboardingRootView.swift

@@ -734,7 +734,13 @@ struct OnboardingNavigationButtons: View {
             }
 
         case .bluetooth:
-            state.shouldDisplayBluetoothRequestAlert = true
+            if let next = currentStep.next {
+                if state.bluetoothManager.bluetoothAuthorization != .authorized {
+                    state.shouldDisplayBluetoothRequestAlert = true
+                } else {
+                    currentStep = next
+                }
+            }
 
         case .completed:
             state.saveOnboardingData()