Skip to content

Commit 537f561

Browse files
committed
Clear service rate tab selection on shipment configuration change
1 parent b5a090b commit 537f561

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/WooShipping Create Shipping Labels/ShipmentDetails/WooShippingShipmentDetailsViewModel.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ private extension WooShippingShipmentDetailsViewModel {
392392
.dropFirst()
393393
.sink { [weak self] _ in
394394
self?.selectedRate = nil
395+
self?.shippingService?.clearSelectedRate()
395396
}
396397
.store(in: &subscriptions)
397398
}

WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/WooShipping Create Shipping Labels/WooShipping Package and Rate Selection/WooShippingServiceViewModel.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ final class WooShippingServiceViewModel: ObservableObject {
7979
analytics.track(event: .WooShipping.rateSelectionStep(state: .selected))
8080
}
8181

82+
/// Clears the selected rate.
83+
func clearSelectedRate() {
84+
selectedRate = nil
85+
}
86+
8287
func refreshSelectedRate(from oldRate: WooShippingSelectedRate) -> WooShippingSelectedRate? {
8388
let updatedStandardRate = standardRates.first(where: {
8489
$0.serviceID == oldRate.rate.serviceID

0 commit comments

Comments
 (0)