diff --git a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/CardReadersV2/BluetoothReaderConnectionAlertsProvider.swift b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/CardReadersV2/BluetoothReaderConnectionAlertsProvider.swift index f2190712ddb..bf3b57e1908 100644 --- a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/CardReadersV2/BluetoothReaderConnectionAlertsProvider.swift +++ b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/CardReadersV2/BluetoothReaderConnectionAlertsProvider.swift @@ -1,4 +1,5 @@ import Foundation +import Yosemite import UIKit struct BluetoothReaderConnectionAlertsProvider: BluetoothReaderConnnectionAlertsProviding { @@ -9,7 +10,12 @@ struct BluetoothReaderConnectionAlertsProvider: BluetoothReaderConnnectionAlerts func scanningFailed(error: Error, close: @escaping () -> Void) -> CardPresentPaymentsModalViewModel { - CardPresentModalScanningFailed(error: error, primaryAction: close) + switch error { + case CardReaderServiceError.bluetoothDenied, CardReaderServiceError.discovery(underlyingError: .bluetoothDenied): + return CardPresentModalBluetoothRequired(error: error, primaryAction: close) + default: + return CardPresentModalScanningFailed(error: error, primaryAction: close) + } } func connectingToReader() -> CardPresentPaymentsModalViewModel { diff --git a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/CardReadersV2/CardReaderSettingsAlerts.swift b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/CardReadersV2/CardReaderSettingsAlerts.swift index 26f0772d0bb..aa5d4cdec2e 100644 --- a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/CardReadersV2/CardReaderSettingsAlerts.swift +++ b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/CardReadersV2/CardReaderSettingsAlerts.swift @@ -176,7 +176,7 @@ private extension CardReaderSettingsAlerts { func scanningFailed(error: Error, close: @escaping () -> Void) -> CardPresentPaymentsModalViewModel { switch error { - case CardReaderServiceError.bluetoothDenied: + case CardReaderServiceError.bluetoothDenied, CardReaderServiceError.discovery(underlyingError: .bluetoothDenied): return CardPresentModalBluetoothRequired(error: error, primaryAction: close) default: return CardPresentModalScanningFailed(error: error, primaryAction: close)