Skip to content

Commit

Permalink
fix: open link in selected article
Browse files Browse the repository at this point in the history
fixes #96
  • Loading branch information
guyfedwards committed Sep 10, 2024
1 parent 6263b22 commit bd841d9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/commands/viewport.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ func updateViewport(msg tea.Msg, m model) (tea.Model, tea.Cmd) {
m.selectedArticle = nil

case key.Matches(msg, ViewportKeyMap.OpenInBrowser):
current := m.list.SelectedItem().(TUIItem)
cmd = m.commands.OpenLink(current.URL)
current, err := m.commands.store.GetItemByID(*m.selectedArticle)
if err != nil {
return m, nil
}

it := ItemToTUIItem(current)
cmd = m.commands.OpenLink(it.URL)
cmds = append(cmds, cmd)

case key.Matches(msg, ViewportKeyMap.Prev):
Expand Down

0 comments on commit bd841d9

Please sign in to comment.