Skip to content

Commit

Permalink
small fix to open prs
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolev Hadar committed Nov 22, 2021
1 parent 8955c14 commit 794cce6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,11 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, nil

case key.Matches(msg, m.keys.Open):
currPR := func() PullRequest {
var prs []PullRequest
for _, section := range *m.data {
prs = append(prs, section.Prs...)
}
return prs[m.cursor.currPrId]
}()
currSection := m.getCurrSection()
if currSection.numPrs() == 0 {
return m, nil
}
currPR := m.getCurrSection().Prs[m.cursor.currPrId]
utils.OpenBrowser(currPR.Url)
return m, nil

Expand Down

0 comments on commit 794cce6

Please sign in to comment.