fix: hide checklist badge if checklist item total is 0

fixes #31
This commit is contained in:
Jordan Knott 2020-08-13 16:33:01 -05:00
parent c2ef8a7d56
commit df4d114b98

View File

@ -1103,6 +1103,9 @@ func (r *taskResolver) Badges(ctx context.Context, obj *db.Task) (*TaskBadges, e
} }
} }
} }
if complete == 0 && total == 0 {
return &TaskBadges{Checklist: nil}, nil
}
return &TaskBadges{Checklist: &ChecklistBadge{Total: total, Complete: complete}}, nil return &TaskBadges{Checklist: &ChecklistBadge{Total: total, Complete: complete}}, nil
} }