Forgiving blurhash

This commit is contained in:
Zhiyuan Zheng 2020-12-30 11:55:51 +01:00
parent 3e3ae67155
commit e765a8fd7c
No known key found for this signature in database
GPG Key ID: 078A93AB607D85E0
2 changed files with 12 additions and 10 deletions

View File

@ -51,6 +51,7 @@ const AttachmentVideo: React.FC<Props> = ({ sensitiveShown, video }) => {
/> />
<Pressable style={styles.overlay}> <Pressable style={styles.overlay}>
{sensitiveShown ? ( {sensitiveShown ? (
video.blurhash ? (
<Surface <Surface
style={{ style={{
width: '100%', width: '100%',
@ -59,6 +60,7 @@ const AttachmentVideo: React.FC<Props> = ({ sensitiveShown, video }) => {
> >
<Blurhash hash={video.blurhash} /> <Blurhash hash={video.blurhash} />
</Surface> </Surface>
) : null
) : ( ) : (
<Button <Button
type='icon' type='icon'

View File

@ -33,11 +33,11 @@ const TimelineCard: React.FC<Props> = ({ card }) => {
if (imageLoaded) { if (imageLoaded) {
return <Image source={{ uri: card.image }} style={styles.image} /> return <Image source={{ uri: card.image }} style={styles.image} />
} else { } else {
return ( return card.blurhash ? (
<Surface style={styles.image}> <Surface style={styles.image}>
<Blurhash hash={card.blurhash} /> <Blurhash hash={card.blurhash} />
</Surface> </Surface>
) ) : null
} }
}, [imageLoaded]) }, [imageLoaded])