From 8c759bcbace9a387d92399d6eee7b90783dd81c7 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Fri, 26 Apr 2024 18:19:13 -0400 Subject: [PATCH] Hide the reactions button if there aren't any. --- apps/ssb.json | 2 +- apps/ssb/tf-message.js | 28 +++++++++++++++------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/apps/ssb.json b/apps/ssb.json index 90fc215a..192ea99d 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🐌", - "previous": "&UDqtNEELPRZAP6jSrcKfoXpAr8s7GjWmWLOQINN4kmg=.sha256" + "previous": "&n79T1PqC7BjDlQsKdVx2ghkjJVfYfq8uWrK0aoeL+qM=.sha256" } diff --git a/apps/ssb/tf-message.js b/apps/ssb/tf-message.js index 19516647..16d24460 100644 --- a/apps/ssb/tf-message.js +++ b/apps/ssb/tf-message.js @@ -72,19 +72,21 @@ class TfMessageElement extends LitElement { return expression; } } - return html`
- ${(this.message.votes || []).map( - (vote) => html` - - ${normalize_expression(vote.content.vote.expression)} - - ` - )} -
`; + if (this.message?.votes?.length) { + return html`
+ ${(this.message.votes || []).map( + (vote) => html` + + ${normalize_expression(vote.content.vote.expression)} + + ` + )} +
`; + } } render_raw() {