Skip to content

Commit 461494a

Browse files
committed
Disable Add Discount product button if the order is loading
When Add Discount is tapped while the order is loading, the order totals are not loaded to calculate base price and discount correctly
1 parent 2e5d86d commit 461494a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

WooCommerce/Classes/ViewRelated/Orders/Order Creation/CollapsibleProductCard.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ private extension CollapsibleProductRowCard {
343343
onAddDiscount(viewModel.id)
344344
}
345345
.buttonStyle(PlusButtonStyle())
346-
.disabled(shouldDisallowDiscounts)
346+
.disabled(shouldDisallowDiscounts || isLoading)
347347
} else {
348348
HStack {
349349
Button(action: {
@@ -357,6 +357,7 @@ private extension CollapsibleProductRowCard {
357357
.frame(width: Layout.iconSize, height: Layout.iconSize)
358358
}
359359
})
360+
.disabled(isLoading)
360361
Spacer()
361362
if let discountLabel = viewModel.discountLabel {
362363
Text(minusSign + discountLabel)

0 commit comments

Comments
 (0)