-
Notifications
You must be signed in to change notification settings - Fork 120
Shipping Labels: Update tabs for shipments with purchased labels #15463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9860bf0
080c197
8644a3e
e3319ce
4984dd9
63676f3
7fbb6b0
fab877b
473bb13
c6f9bab
9111c85
5905ccd
12f71aa
4e310d2
8a33bbb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -275,8 +275,12 @@ final class WooShippingCreateLabelsViewModel: ObservableObject { | |
| } | ||
| } | ||
|
|
||
| group.addTask { | ||
| await self.loadShipmentsInfo() | ||
| let totalOrderItems = order.items.map(\.quantity).reduce(0, +) | ||
| if totalOrderItems > 1 { | ||
| // Only fetch shipments info if there are more than one order items. | ||
| group.addTask { | ||
| await self.loadShipmentsInfo() | ||
| } | ||
|
Comment on lines
+278
to
+283
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: We could move this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I plan to remove this check when working on #15309, so I'll keep this for now. |
||
| } | ||
| } | ||
|
|
||
|
|
@@ -443,7 +447,6 @@ private extension WooShippingCreateLabelsViewModel { | |
| stores.dispatch(action) | ||
| } | ||
|
|
||
| // TODO: Create view model only if order has more than 1 items that can be split into multiple shipments. (Check web logic) | ||
| if let config { | ||
| splitShipmentsViewModel = WooShippingSplitShipmentsViewModel(order: order, | ||
| config: config, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While testing again I saw that the shipment ID was somehow returned as a number today. This is a workaround to transform the number to our expected string type.