Skip to content

Commit 39c5b9b

Browse files
committed
Improve disable logic for branch combo box.
1 parent d0f84e8 commit 39c5b9b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CCMenu/Source/Pipeline Window/GitHub Sheets/AddGitHubPipelineSheet.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ struct AddGitHubPipelineSheet: View {
109109
LabeledContent("Branch:") {
110110
ComboBox(items: branchList.items.map({ $0.name }), text: $branch.input)
111111
.accessibilityIdentifier("Branch combo box")
112-
.disabled(owner.text.isEmpty || repository.text.isEmpty || repository.text.starts(with: "("))
112+
.disabled(!workflowList.selected.isValid)
113113
.onReceive(branch.$text) { t in
114114
builder.branch = t
115115
}

CCMenu/Source/Pipeline Window/GitHub Sheets/GitHubPipelineBuilder.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ class GitHubPipelineBuilder: ObservableObject {
2626

2727
var canMakePipeline: Bool {
2828
guard !name.isEmpty else { return false }
29-
guard let owner else { return false }
30-
guard let repository else { return false }
29+
guard owner?.isEmpty == false else { return false }
30+
guard repository?.isEmpty == false else { return false }
3131
guard let workflow, workflow.isValid else { return false }
32-
guard let branch else { return false }
32+
guard branch != nil else { return false }
3333
return true
3434
}
3535

0 commit comments

Comments
 (0)