Skip to content

Commit ae7a85b

Browse files
committed
5479 Prevent error display when update cancelled
1 parent 572107e commit ae7a85b

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
@@ -536,15 +536,19 @@ private extension CardReaderConnectionController {
536536
return
537537
}
538538

539-
if underlyingError == .readerSoftwareUpdateFailedBatteryLow {
539+
switch underlyingError {
540+
case .readerSoftwareUpdateFailedInterrupted:
541+
// Update was cancelled, don't treat this as an error
542+
return
543+
case .readerSoftwareUpdateFailedBatteryLow:
540544
alerts.updatingFailedLowBattery(
541545
from: from,
542546
batteryLevel: batteryLevel,
543547
close: {
544548
self.state = .searching
545549
}
546550
)
547-
} else {
551+
default:
548552
alerts.updatingFailed(
549553
from: from,
550554
tryAgain: nil,

0 commit comments

Comments
 (0)