-
Notifications
You must be signed in to change notification settings - Fork 121
Order details: Fix crash when reloading orders #15764
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 2 commits
530c10f
a308394
dc7f0dc
1737b8e
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 |
|---|---|---|
|
|
@@ -136,27 +136,19 @@ final class OrderDetailsDataSource: NSObject { | |
|
|
||
| /// Order shipment tracking list | ||
| /// | ||
| var orderTracking: [ShipmentTracking] { | ||
| return resultsControllers.orderTracking | ||
| } | ||
| var orderTracking: [ShipmentTracking] = [] | ||
|
|
||
| /// Order statuses list | ||
| /// | ||
| var currentSiteStatuses: [OrderStatus] { | ||
| return resultsControllers.currentSiteStatuses | ||
| } | ||
| var currentSiteStatuses: [OrderStatus] = [] | ||
|
|
||
| /// Products from an Order | ||
| /// | ||
| var products: [Product] { | ||
| return resultsControllers.products | ||
| } | ||
| var products: [Product] = [] | ||
|
|
||
| /// Custom amounts (fees) from an Order | ||
| /// | ||
| var customAmounts: [OrderFeeLine] { | ||
| return resultsControllers.feeLines | ||
| } | ||
| var customAmounts: [OrderFeeLine] = [] | ||
|
|
||
| /// OrderItemsRefund Count | ||
| /// | ||
|
|
@@ -166,19 +158,13 @@ final class OrderDetailsDataSource: NSObject { | |
|
|
||
| /// Refunds on an Order | ||
| /// | ||
| var refunds: [Refund] { | ||
| return resultsControllers.refunds | ||
| } | ||
| var refunds: [Refund] = [] | ||
|
|
||
| var addOnGroups: [AddOnGroup] { | ||
| resultsControllers.addOnGroups | ||
| } | ||
| var addOnGroups: [AddOnGroup] = [] | ||
|
|
||
| /// Shipping Methods list | ||
| /// | ||
| var siteShippingMethods: [ShippingMethod] { | ||
| resultsControllers.siteShippingMethods | ||
| } | ||
| var siteShippingMethods: [ShippingMethod] = [] | ||
|
|
||
| /// Shipping Labels for an Order | ||
| /// | ||
|
|
@@ -1202,6 +1188,13 @@ extension OrderDetailsDataSource { | |
| products: products, | ||
| productVariations: resultsControllers.productVariations | ||
| ) | ||
| refunds = resultsControllers.refunds | ||
| customAmounts = resultsControllers.feeLines | ||
| orderTracking = resultsControllers.orderTracking | ||
| currentSiteStatuses = resultsControllers.currentSiteStatuses | ||
| products = resultsControllers.products | ||
| addOnGroups = resultsControllers.addOnGroups | ||
| siteShippingMethods = resultsControllers.siteShippingMethods | ||
|
Comment on lines
+1188
to
+1194
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. How about also freezing
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. This probably requires some refactoring, but I was wondering if a crash could still happen when there are two
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'm struggling to understand your suggestions here, so it'd be nice if you could clarify your suggestions further. From my understanding, it'd be simpler if the
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.
The variables are also accessed when configuring cells, so it cannot be a simple as passing them through to determine sections. |
||
|
|
||
| var sections = buildStaticSections().compactMap { $0 } | ||
| let paymentSection = await createPaymentSection() | ||
|
|
||
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.
❓ How is this
productsdifferent from theproductsbelow in L1195? Shall we use the same products in the beginning of the function?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.
Good point - addressed in dc7f0dc.