1
0
Fork 0

Fixed TODO, added error handling

This commit is contained in:
マリウス 2023-01-05 12:21:48 -05:00
parent e234ab044e
commit 939280a693
No known key found for this signature in database
GPG Key ID: 272ED814BF63261F
1 changed files with 6 additions and 6 deletions

View File

@ -75,11 +75,6 @@ func NewModel(c *ctx.Ctx) Model {
m.list.SetShowTitle(false)
m.list.SetShowStatusBar(false)
m.a, _ = aggregator.New(m.ctx)
return m
}
func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
var cmds []tea.Cmd
@ -163,7 +158,12 @@ func (m *Model) refresh() tea.Cmd {
posts, errs := m.a.ListPosts()
if len(errs) > 0 {
fmt.Printf("%s", errs) // TODO: Implement error message
m.ctx.Logger.Error(err)
return *cmd.New(
cmd.MsgError,
WIN_ID,
cmd.Arg{Name: "errors", Value: errs},
)
}
for _, post := range posts {
items = append(items, post)