Skip to content

Commit 1da71a3

Browse files
authored
Merge pull request #5480 from woocommerce/issue/5479-cancelling-mandatory-update-flashes-error
[Mobile Payments] Prevent error from being displayed when a mandatory update is cancelled
2 parents 86ec0a9 + ae7a85b commit 1da71a3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

WooCommerce/Classes/ViewRelated/CardPresentPayments/CardReaderConnectionController.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,15 +539,19 @@ private extension CardReaderConnectionController {
539539
return
540540
}
541541

542-
if underlyingError == .readerSoftwareUpdateFailedBatteryLow {
542+
switch underlyingError {
543+
case .readerSoftwareUpdateFailedInterrupted:
544+
// Update was cancelled, don't treat this as an error
545+
return
546+
case .readerSoftwareUpdateFailedBatteryLow:
543547
alerts.updatingFailedLowBattery(
544548
from: from,
545549
batteryLevel: batteryLevel,
546550
close: {
547551
self.state = .searching
548552
}
549553
)
550-
} else {
554+
default:
551555
alerts.updatingFailed(
552556
from: from,
553557
tryAgain: nil,

0 commit comments

Comments
 (0)