Skip to content

Commit

Permalink
remove unused max
Browse files Browse the repository at this point in the history
  • Loading branch information
k1nho committed Sep 9, 2023
1 parent b1289a1 commit ad8609a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
2 changes: 0 additions & 2 deletions cmd/show/contributors.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ func (m *ContributorModel) fetchUser() (tea.Model, error) {

// fetchContributorInfo: fetches the contributor info
func (m *ContributorModel) fetchContributorInfo(name string) (*client.DbUser, error) {

resp, r, err := m.APIClient.UserServiceAPI.FindOneUserByUserame(m.serverContext, name).Execute()
if err != nil {
return nil, err
Expand All @@ -127,7 +126,6 @@ func (m *ContributorModel) fetchContributorInfo(name string) (*client.DbUser, er

// fetchContributorPRs: fetches the contributor pull requests
func (m *ContributorModel) fetchContributorPRs(name string) ([]client.DbPullRequest, error) {

resp, r, err := m.APIClient.UserServiceAPI.FindContributorPullRequests(m.serverContext, name).Execute()
if err != nil {
return nil, err
Expand Down
14 changes: 2 additions & 12 deletions cmd/show/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,14 @@ func (m DashboardModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case "q", "esc", "ctrl+c", "ctrl+d":
return m, tea.Quit
case "enter":
var contributorName string
switch m.tableView {
case newContributorsView:
if len(m.newContributorsTable.Rows()) > 0 {
contributorName = m.newContributorsTable.SelectedRow()[1]
return m, func() tea.Msg { return SelectMsg{contributorName} }
return m, func() tea.Msg { return SelectMsg{contributorName: m.newContributorsTable.SelectedRow()[1]} }
}
case alumniContributorsView:
if len(m.alumniContributorsTable.Rows()) > 0 {
contributorName = m.alumniContributorsTable.SelectedRow()[1]
return m, func() tea.Msg { return SelectMsg{contributorName} }
return m, func() tea.Msg { return SelectMsg{contributorName: m.alumniContributorsTable.SelectedRow()[1]} }
}
}
}
Expand Down Expand Up @@ -337,10 +334,3 @@ func setupContributorsTable(contributors []client.DbPullRequestContributor) tabl
contributorTable.SetStyles(s)
return contributorTable
}

func max(a, b int) int {
if a > b {
return a
}
return b
}
2 changes: 1 addition & 1 deletion cmd/show/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type Options struct {

const showLongDesc string = `WARNING: Proof of concept feature.
The show command accepts the name of a git repository in the format 'owner/name' and uses OpenSauced api
The show command accepts the name of a git repository and uses OpenSauced api
to retrieve metrics of the repository to be displayed as a TUI.`

// NewShowCommand returns a new cobra command for 'pizza show'
Expand Down

0 comments on commit ad8609a

Please sign in to comment.