From f732bd44ab600b3b7d6ae0aa6af2596e1a45bf93 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sun, 19 Aug 2018 11:31:02 -0700 Subject: [PATCH] fix statuses with empty content text (#446) fixes #445 --- routes/_components/status/Status.html | 3 ++- routes/_components/status/StatusContent.html | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/routes/_components/status/Status.html b/routes/_components/status/Status.html index 4f0eb903..1e3ff318 100644 --- a/routes/_components/status/Status.html +++ b/routes/_components/status/Status.html @@ -21,7 +21,7 @@ {#if !showContent} {/if} - {#if showContent || contentPreloaded} + {#if content && (showContent || contentPreloaded)} {/if} {#if showMedia } @@ -223,6 +223,7 @@ timelineType !== 'search' && 'status-in-timeline', isStatusInOwnThread && 'status-in-own-thread' )), + content: ({ originalStatus }) => originalStatus.content || '', showContent: ({ spoilerText, spoilerShown }) => !spoilerText || spoilerShown, params: ({ notification, notificationId, status, statusId, timelineType, account, accountId, uuid, isStatusInNotification, isStatusInOwnThread, diff --git a/routes/_components/status/StatusContent.html b/routes/_components/status/StatusContent.html index 1cd5e6c2..ae2c03d6 100644 --- a/routes/_components/status/StatusContent.html +++ b/routes/_components/status/StatusContent.html @@ -79,13 +79,13 @@ shown && 'shown' ) }, - content: ({ originalStatus }) => originalStatus.content, + content: ({ originalStatus }) => (originalStatus.content || ''), emojis: ({ originalStatus }) => originalStatus.emojis, massagedContent: ({ content, emojis, $autoplayGifs }) => { content = emojifyText(content, emojis, $autoplayGifs) // GNU Social and Pleroma don't add

tags - if (!content.startsWith('

')) { + if (content && !content.startsWith('

')) { content = `

${content}

` } return content