From df4d114b98d7bd5aa0d68c9ebab73f464cc28721 Mon Sep 17 00:00:00 2001 From: Jordan Knott Date: Thu, 13 Aug 2020 16:33:01 -0500 Subject: [PATCH] fix: hide checklist badge if checklist item total is 0 fixes #31 --- internal/graph/schema.resolvers.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/graph/schema.resolvers.go b/internal/graph/schema.resolvers.go index 756ed49..93a61e4 100644 --- a/internal/graph/schema.resolvers.go +++ b/internal/graph/schema.resolvers.go @@ -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 }