Skip to content

Commit f07b64f

Browse files
committed
Use shouldShowMoreOptionsMenu() when deciding whether to add .more
I should have done this before.
1 parent b2ab931 commit f07b64f

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

WooCommerce/Classes/ViewRelated/Products/Edit Product/ProductVariationFormViewModel.swift

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,20 @@ final class ProductVariationFormViewModel: ProductFormViewModelProtocol {
6565

6666
/// The action buttons that should be rendered in the navigation bar.
6767
var actionButtons: [ActionButtonType] {
68-
switch (formType, hasUnsavedChanges()) {
69-
case (.edit, true):
70-
return [.save, .more]
71-
default:
72-
return [.more]
68+
var buttons: [ActionButtonType] = {
69+
switch (formType, hasUnsavedChanges()) {
70+
case (.edit, true):
71+
return [.save]
72+
default:
73+
return []
74+
}
75+
}()
76+
77+
if shouldShowMoreOptionsMenu() {
78+
buttons.append(.more)
7379
}
80+
81+
return buttons
7482
}
7583

7684
/// Assign this closure to get notified when the variation is deleted.

0 commit comments

Comments
 (0)