mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Fix remote toot not interactable
This commit is contained in:
@ -11,7 +11,7 @@ import { usePreferencesQuery } from '@utils/queryHooks/preferences'
|
||||
import { StyleConstants } from '@utils/styles/constants'
|
||||
import { isLargeDevice } from '@utils/styles/scaling'
|
||||
import { chunk } from 'lodash'
|
||||
import React, { useContext, useState } from 'react'
|
||||
import React, { Fragment, useContext, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Pressable, View } from 'react-native'
|
||||
import StatusContext from '../Context'
|
||||
@ -72,14 +72,9 @@ const TimelineAttachment = () => {
|
||||
}
|
||||
default:
|
||||
if (
|
||||
attachment.preview_url?.endsWith('.jpg') ||
|
||||
attachment.preview_url?.endsWith('.jpeg') ||
|
||||
attachment.preview_url?.endsWith('.png') ||
|
||||
attachment.preview_url?.endsWith('.gif') ||
|
||||
attachment.remote_url?.endsWith('.jpg') ||
|
||||
attachment.remote_url?.endsWith('.jpeg') ||
|
||||
attachment.remote_url?.endsWith('.png') ||
|
||||
attachment.remote_url?.endsWith('.gif')
|
||||
// https://docs.expo.dev/versions/unversioned/sdk/image/#supported-image-formats
|
||||
attachment.preview_url?.match(/.(?:a?png|jpe?g|webp|avif|heic|gif|svg|ico|icns)$/i) ||
|
||||
attachment.remote_url?.match(/.(?:a?png|jpe?g|webp|avif|heic|gif|svg|ico|icns)$/i)
|
||||
) {
|
||||
return {
|
||||
id: attachment.id,
|
||||
@ -186,6 +181,7 @@ const TimelineAttachment = () => {
|
||||
>
|
||||
{chunk(status.media_attachments, 2).map((chunk, chunkIndex) => (
|
||||
<View
|
||||
key={chunkIndex}
|
||||
style={{
|
||||
flex: 1,
|
||||
flexDirection: 'row',
|
||||
@ -195,7 +191,9 @@ const TimelineAttachment = () => {
|
||||
gap: StyleConstants.Spacing.XS
|
||||
}}
|
||||
>
|
||||
{chunk.map((a, aIndex) => mapAttachmentType(a, chunkIndex * 2 + aIndex))}
|
||||
{chunk.map((a, aIndex) => (
|
||||
<Fragment key={aIndex}>{mapAttachmentType(a, chunkIndex * 2 + aIndex)}</Fragment>
|
||||
))}
|
||||
</View>
|
||||
))}
|
||||
|
||||
|
Reference in New Issue
Block a user