Skip to content

Commit 347862e

Browse files
Fix variable product selector navigation (#16363)
2 parents e19e9f6 + 394fc04 commit 347862e

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

RELEASE-NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
23.8
55
-----
6-
6+
- [Internal] Fix broken navigation to a variable product selector [https://github.com/woocommerce/woocommerce-ios/pull/16363]
77

88
23.7
99
-----

WooCommerce/Classes/ViewRelated/Products/ProductSelector/ProductSelectorView.swift

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,23 @@ struct ProductSelectorView: View {
116116
.padding(Constants.defaultPadding)
117117
.accessibilityIdentifier(Constants.doneButtonAccessibilityIdentifier)
118118
.renderedIf(configuration.multipleSelectionEnabled && viewModel.syncApproach == .onButtonTap)
119-
120-
if let variationListViewModel = viewModel.productVariationListViewModel {
121-
LazyNavigationLink(destination: ProductVariationSelectorView(
122-
isPresented: $isPresented,
123-
viewModel: variationListViewModel,
124-
onMultipleSelections: { selectedIDs in
125-
viewModel.updateSelectedVariations(productID: variationListViewModel.productID, selectedVariationIDs: selectedIDs)
126-
}), isActive: $viewModel.isShowingProductVariationList) {
127-
EmptyView()
128-
}
129-
.renderedIf(configuration.treatsAllProductsAsSimple == false)
119+
}
120+
.if(configuration.treatsAllProductsAsSimple == false) { view in
121+
view.navigationDestination(isPresented: $viewModel.isShowingProductVariationList) {
122+
if let variationListViewModel = viewModel.productVariationListViewModel {
123+
ProductVariationSelectorView(
124+
isPresented: $isPresented,
125+
viewModel: variationListViewModel,
126+
onMultipleSelections: { selectedIDs in
127+
viewModel.updateSelectedVariations(
128+
productID: variationListViewModel.productID,
129+
selectedVariationIDs: selectedIDs
130+
)
131+
}
132+
)
133+
} else {
134+
EmptyView()
135+
}
130136
}
131137
}
132138
.padding(.horizontal, insets: safeAreaInsets)

0 commit comments

Comments
 (0)