Skip to content

Commit 45c2d23

Browse files
committed
Prevent from picking draft
1 parent 630bb0b commit 45c2d23

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

WordPress/Classes/ViewRelated/Post/PostSettings/Views/PostStatusView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ struct PostStatusView: View {
1414
private var statusRowLeadingInset: CGFloat = PostStatusRow.leadingInset
1515

1616
private var statuses: [BasePost.Status] {
17-
var all = [.draft, .pending, .publishPrivate, .scheduled, .publish]
18-
if isPublishing, let index = all.firstIndex(of: .draft) {
19-
all.remove(at: index)
17+
var statuses: [BasePost.Status] = [.draft, .pending, .publishPrivate, .scheduled, .publish]
18+
if isPublishing {
19+
statuses.removeAll { $0 == .draft }
2020
}
21-
return all
21+
return statuses
2222
}
2323

2424
var body: some View {

0 commit comments

Comments
 (0)