fix statuses with empty content text (#446)

fixes #445
This commit is contained in:
Nolan Lawson 2018-08-19 11:31:02 -07:00 committed by GitHub
parent 1aeb57fb57
commit f732bd44ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -21,7 +21,7 @@
{#if !showContent} {#if !showContent}
<StatusMentions {...params} /> <StatusMentions {...params} />
{/if} {/if}
{#if showContent || contentPreloaded} {#if content && (showContent || contentPreloaded)}
<StatusContent {...params} shown={showContent}/> <StatusContent {...params} shown={showContent}/>
{/if} {/if}
{#if showMedia } {#if showMedia }
@ -223,6 +223,7 @@
timelineType !== 'search' && 'status-in-timeline', timelineType !== 'search' && 'status-in-timeline',
isStatusInOwnThread && 'status-in-own-thread' isStatusInOwnThread && 'status-in-own-thread'
)), )),
content: ({ originalStatus }) => originalStatus.content || '',
showContent: ({ spoilerText, spoilerShown }) => !spoilerText || spoilerShown, showContent: ({ spoilerText, spoilerShown }) => !spoilerText || spoilerShown,
params: ({ notification, notificationId, status, statusId, timelineType, params: ({ notification, notificationId, status, statusId, timelineType,
account, accountId, uuid, isStatusInNotification, isStatusInOwnThread, account, accountId, uuid, isStatusInNotification, isStatusInOwnThread,

View File

@ -79,13 +79,13 @@
shown && 'shown' shown && 'shown'
) )
}, },
content: ({ originalStatus }) => originalStatus.content, content: ({ originalStatus }) => (originalStatus.content || ''),
emojis: ({ originalStatus }) => originalStatus.emojis, emojis: ({ originalStatus }) => originalStatus.emojis,
massagedContent: ({ content, emojis, $autoplayGifs }) => { massagedContent: ({ content, emojis, $autoplayGifs }) => {
content = emojifyText(content, emojis, $autoplayGifs) content = emojifyText(content, emojis, $autoplayGifs)
// GNU Social and Pleroma don't add <p> tags // GNU Social and Pleroma don't add <p> tags
if (!content.startsWith('<p>')) { if (content && !content.startsWith('<p>')) {
content = `<p>${content}</p>` content = `<p>${content}</p>`
} }
return content return content