Skip to content

Commit

Permalink
remove the safe-nav operator that could end up doing the exact opposi…
Browse files Browse the repository at this point in the history
…te of what I want
  • Loading branch information
xunker committed Sep 17, 2024
1 parent b6ebaea commit b181249
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/linear/cli/projects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def project_scores(projects, search_term)
projects.select { |p| p.match_score?(search_term).positive? }.sort_by { |p| p.match_score?(search_term) }
end

def project_for(project = nil, projects: Project.all) # rubocop:disable Metrics/CyclomaticComplexity
return nil if projects&.empty?
def project_for(project = nil, projects: Project.all)
return nil if projects.empty?

possibles = project ? project_scores(projects, project) : []
return ask_for_projects(projects, search: project) if possibles.empty?
Expand Down

0 comments on commit b181249

Please sign in to comment.