From 09ea4cd874a6004b607bb9f267f1f4226b5a7772 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 24 May 2019 14:26:03 -0700 Subject: [PATCH] Todoist now properly updates list items when Refresh() is called --- modules/todoist/widget.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/todoist/widget.go b/modules/todoist/widget.go index 2a4ca8a1..1b1039c1 100644 --- a/modules/todoist/widget.go +++ b/modules/todoist/widget.go @@ -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 {