Skip to content

Commit f31c7f2

Browse files
committed
Revert change to WooShippingItemsDataSource's product
1 parent a761e14 commit f31c7f2

File tree

1 file changed

+4
-2
lines changed
  • WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/WooShipping Create Shipping Labels/WooShipping Items Section

1 file changed

+4
-2
lines changed

WooCommerce/Classes/ViewRelated/Orders/Order Details/Shipping Labels/WooShipping Create Shipping Labels/WooShipping Items Section/WooShippingItemsDataSource.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ final class DefaultWooShippingItemsDataSource: WooShippingItemsDataSource {
3030

3131
/// Stored products that match the items in the order.
3232
///
33-
private var products: [ProductListItem] = []
33+
private var products: [ProductListItem] {
34+
try? productResultsController.performFetch()
35+
return productResultsController.listItemObjects
36+
}
3437

3538
/// Stored product variations that match the items in the order.
3639
///
@@ -76,7 +79,6 @@ final class DefaultWooShippingItemsDataSource: WooShippingItemsDataSource {
7679
private func configureProductResultsController() {
7780
do {
7881
try productResultsController.performFetch()
79-
products = productResultsController.listItemObjects
8082
} catch {
8183
DDLogError("⛔️ Error fetching products for Woo Shipping label creation: \(error)")
8284
}

0 commit comments

Comments
 (0)