Fix long-form note display

This commit is contained in:
Bojan Mojsilovic 2024-03-26 15:07:54 +01:00
parent 5d08eeb097
commit 1638029c93
3 changed files with 6 additions and 6 deletions

View File

@ -63,10 +63,10 @@ const LinkPreview: Component<{ preview: any, id?: string, bordered?: boolean, is
class={klass()}
target="_blank"
>
<Show when={image()}>
<Show when={image() || props.preview.images[0]}>
<img
class={styles.previewImage}
src={image()?.media_url}
src={image()?.media_url || props.preview.images[0]}
style={`width: 100%; height: ${height()}`}
onerror={onError}
/>

View File

@ -797,9 +797,9 @@ const ParsedNote: Component<{
const preview = {
url,
description: mention.post.content.slice(0, 100),
images: [mention.user.picture],
title: authorName(mention.user),
description: (mention.post.tags.find(t => t[0] === 'summary') || [])[1] || mention.post.content.slice(0, 100),
images: [(mention.post.tags.find(t => t[0] === 'image') || [])[1] || mention.user.picture],
title: (mention.post.tags.find(t => t[0] === 'title') || [])[1] || authorName(mention.user),
}
return <LinkPreview

View File

@ -995,7 +995,7 @@ export const placeholders = {
missingNote: {
firstLine: {
id: 'placeholders.missingNote.firstLine',
defaultMessage: 'Oups! We can\'t seem to find this note.',
defaultMessage: 'We can\'t seem to find this note.',
description: 'Placeholder when the note is missing',
},
secondLine: {