mirror of
https://github.com/mrusme/neonmodem.git
synced 2024-12-04 14:46:37 -05:00
Fixed TODO, added error handling
This commit is contained in:
parent
e234ab044e
commit
939280a693
@ -75,11 +75,6 @@ func NewModel(c *ctx.Ctx) Model {
|
|||||||
m.list.SetShowTitle(false)
|
m.list.SetShowTitle(false)
|
||||||
m.list.SetShowStatusBar(false)
|
m.list.SetShowStatusBar(false)
|
||||||
|
|
||||||
m.a, _ = aggregator.New(m.ctx)
|
|
||||||
|
|
||||||
return m
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||||
var cmds []tea.Cmd
|
var cmds []tea.Cmd
|
||||||
|
|
||||||
@ -163,7 +158,12 @@ func (m *Model) refresh() tea.Cmd {
|
|||||||
|
|
||||||
posts, errs := m.a.ListPosts()
|
posts, errs := m.a.ListPosts()
|
||||||
if len(errs) > 0 {
|
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 {
|
for _, post := range posts {
|
||||||
items = append(items, post)
|
items = append(items, post)
|
||||||
|
Loading…
Reference in New Issue
Block a user