Skip to content

Commit 086ac0e

Browse files
committed
Refactor private comment badge rendering logic
1 parent ba171ff commit 086ac0e

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

packages/comment-widget/src/base-comment-item.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,13 @@ export class BaseCommentItem extends LitElement {
7272
`
7373
)}
7474
75-
76-
${
77-
this.private && this.configMapData?.basic.showPrivateCommentBadge
78-
? html`
79-
<div class="inline-flex items-center gap-1 bg-muted-3 rounded-base px-1.5 py-1">
75+
${when(
76+
this.private && this.configMapData?.basic.showPrivateCommentBadge,
77+
() => html`<div class="inline-flex items-center gap-1 bg-muted-3 rounded-base px-1.5 py-1">
8078
<i class="i-ri-git-repository-private-line opacity-90 size-3" aria-hidden="true"></i>
8179
<span class="text-xs text-text-2">${msg('Private')}</span>
8280
</div>`
83-
: ''
84-
}
81+
)}
8582
8683
${when(this.ua && this.configMapData?.basic.showCommenterDevice, () => html`<commenter-ua-bar .ua=${this.ua}></commenter-ua-bar>`)}
8784

0 commit comments

Comments
 (0)