From eaf2d06d2f7cb29c33a4fe4f06e52e18d39be246 Mon Sep 17 00:00:00 2001 From: Ankit Pokhrel Date: Mon, 8 May 2023 10:22:48 +0200 Subject: [PATCH] fix: Comment author name is not always displayed (#618) --- internal/view/issue.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/view/issue.go b/internal/view/issue.go index 517c95b0..80ed1993 100644 --- a/internal/view/issue.go +++ b/internal/view/issue.go @@ -400,9 +400,15 @@ func (i Issue) comments() []issueComment { body = c.Body.(string) body = md.FromJiraMD(body) } + authorName := func() string { + if c.Author.DisplayName != "" { + return c.Author.DisplayName + } + return c.Author.Name + } meta := fmt.Sprintf( "\n %s • %s", - coloredOut(c.Author.Name, color.FgWhite, color.Bold), + coloredOut(authorName(), color.FgWhite, color.Bold), coloredOut(cmdutil.FormatDateTimeHuman(c.Created, jira.RFC3339), color.FgWhite, color.Bold), ) if idx == total-1 {