Skip to content

Commit a5ffc3d

Browse files
committed
Code style improvements
1 parent 2d60abe commit a5ffc3d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

WooCommerce/Classes/ViewRelated/Products/Edit Product/Product Settings/ProductSettingsRows.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ enum ProductSettingsRows {
4040
}
4141

4242
/// If the status is private, the status cell becomes not editable.
43-
if settings.status == .privateStatus {
43+
if isStatusPrivate() {
4444
cell.accessoryType = .none
4545
cell.selectionStyle = .none
4646
cell.applyNonSelectableLabelsStyle()
@@ -57,7 +57,7 @@ enum ProductSettingsRows {
5757
func handleTap(sourceViewController: UIViewController, onCompletion: @escaping (ProductSettings) -> Void) {
5858

5959
/// If the status is private, the cell doesn't trigger any action
60-
guard settings.status != .privateStatus else {
60+
guard isStatusPrivate() else {
6161
return
6262
}
6363

@@ -75,6 +75,11 @@ enum ProductSettingsRows {
7575
let reuseIdentifier: String = SettingTitleAndValueTableViewCell.reuseIdentifier
7676

7777
let cellTypes: [UITableViewCell.Type] = [SettingTitleAndValueTableViewCell.self]
78+
79+
/// Utils
80+
func isStatusPrivate() -> Bool {
81+
return settings.status == .privateStatus
82+
}
7883
}
7984

8085
struct Visibility: ProductSettingsRowMediator {

0 commit comments

Comments
 (0)