Skip to content

Commit 0394ed4

Browse files
committed
Do not show password visibility row if password cannot be fetched
1 parent 79e0212 commit 0394ed4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

WooCommerce/Classes/ViewRelated/Products/Edit Product/Product Settings/Visibility/ProductVisibilityViewController.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ final class ProductVisibilityViewController: UIViewController {
6565
private func reloadSections() {
6666
if visibility == .passwordProtected {
6767
sections = [Section(rows: [.publicVisibility, .passwordVisibility, .passwordField, .privateVisibility])]
68-
}
69-
else {
68+
} else if productSettings.password != nil {
7069
sections = [Section(rows: [.publicVisibility, .passwordVisibility, .privateVisibility])]
70+
} else {
71+
sections = [Section(rows: [.publicVisibility, .privateVisibility])]
7172
}
7273
tableView.reloadData()
7374
}

0 commit comments

Comments
 (0)