Skip to content

Commit

Permalink
Todoist now properly updates list items when Refresh() is called
Browse files Browse the repository at this point in the history
  • Loading branch information
senorprogrammer committed May 24, 2019
1 parent 9a877b5 commit 09ea4cd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions modules/todoist/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ func (widget *Widget) ProjectAt(idx int) *Project {
return widget.projects[idx]
}

func (w *Widget) Refresh() {
if w.Disabled() || w.CurrentProject() == nil {
w.SetItemCount(0)
func (widget *Widget) Refresh() {
widget.loadProjects()

if widget.Disabled() || widget.CurrentProject() == nil {
widget.SetItemCount(0)
return
}

w.SetItemCount(len(w.CurrentProject().tasks))
w.display()
widget.SetItemCount(len(widget.CurrentProject().tasks))
widget.display()
}

func (widget *Widget) HelpText() string {
Expand Down

0 comments on commit 09ea4cd

Please sign in to comment.