Skip to content

Commit

Permalink
Improve disable logic for branch combo box.
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdoe committed Feb 9, 2025
1 parent d0f84e8 commit 39c5b9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ struct AddGitHubPipelineSheet: View {
LabeledContent("Branch:") {
ComboBox(items: branchList.items.map({ $0.name }), text: $branch.input)
.accessibilityIdentifier("Branch combo box")
.disabled(owner.text.isEmpty || repository.text.isEmpty || repository.text.starts(with: "("))
.disabled(!workflowList.selected.isValid)
.onReceive(branch.$text) { t in
builder.branch = t
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class GitHubPipelineBuilder: ObservableObject {

var canMakePipeline: Bool {
guard !name.isEmpty else { return false }
guard let owner else { return false }
guard let repository else { return false }
guard owner?.isEmpty == false else { return false }
guard repository?.isEmpty == false else { return false }
guard let workflow, workflow.isValid else { return false }
guard let branch else { return false }
guard branch != nil else { return false }
return true
}

Expand Down

0 comments on commit 39c5b9b

Please sign in to comment.