mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Fix crashes
This commit is contained in:
File diff suppressed because one or more lines are too long
@ -72,7 +72,7 @@ const Timeline: React.FC<Props> = ({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const flattenData = data?.pages
|
const flattenData = data?.pages
|
||||||
? data.pages.flatMap(page => [...page.body])
|
? data.pages?.flatMap(page => [...page.body])
|
||||||
: []
|
: []
|
||||||
|
|
||||||
const ItemSeparatorComponent = useCallback(
|
const ItemSeparatorComponent = useCallback(
|
||||||
|
@ -108,10 +108,10 @@ const TimelineAttachment = React.memo(
|
|||||||
)
|
)
|
||||||
default:
|
default:
|
||||||
if (
|
if (
|
||||||
attachment.preview_url.endsWith('.jpg') ||
|
attachment.preview_url?.endsWith('.jpg') ||
|
||||||
attachment.preview_url.endsWith('.jpeg') ||
|
attachment.preview_url?.endsWith('.jpeg') ||
|
||||||
attachment.preview_url.endsWith('.png') ||
|
attachment.preview_url?.endsWith('.png') ||
|
||||||
attachment.preview_url.endsWith('.gif') ||
|
attachment.preview_url?.endsWith('.gif') ||
|
||||||
attachment.remote_url?.endsWith('.jpg') ||
|
attachment.remote_url?.endsWith('.jpg') ||
|
||||||
attachment.remote_url?.endsWith('.jpeg') ||
|
attachment.remote_url?.endsWith('.jpeg') ||
|
||||||
attachment.remote_url?.endsWith('.png') ||
|
attachment.remote_url?.endsWith('.png') ||
|
||||||
|
@ -333,7 +333,7 @@ const ScreenCompose: React.FC<RootStackScreenProps<'Screen-Compose'>> = ({
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
Sentry.Native.captureException(error)
|
Sentry.Native.captureMessage('Compose posting', error)
|
||||||
haptics('Error')
|
haptics('Error')
|
||||||
composeDispatch({ type: 'posting', payload: false })
|
composeDispatch({ type: 'posting', payload: false })
|
||||||
Alert.alert(t('heading.right.alert.default.title'), undefined, [
|
Alert.alert(t('heading.right.alert.default.title'), undefined, [
|
||||||
|
@ -42,11 +42,13 @@ const ComposeEditAttachmentSubmit: React.FC<Props> = ({ index }) => {
|
|||||||
) {
|
) {
|
||||||
formData.append(
|
formData.append(
|
||||||
'focus',
|
'focus',
|
||||||
`${theAttachment.meta?.focus?.x || 0},${-theAttachment.meta?.focus
|
`${theAttachment.meta?.focus?.x || 0},${
|
||||||
?.y || 0}`
|
-theAttachment.meta?.focus?.y || 0
|
||||||
|
}`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
theAttachment?.id &&
|
||||||
apiInstance<Mastodon.Attachment>({
|
apiInstance<Mastodon.Attachment>({
|
||||||
method: 'put',
|
method: 'put',
|
||||||
url: `media/${theAttachment.id}`,
|
url: `media/${theAttachment.id}`,
|
||||||
@ -64,7 +66,9 @@ const ComposeEditAttachmentSubmit: React.FC<Props> = ({ index }) => {
|
|||||||
undefined,
|
undefined,
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
text: t('content.editAttachment.header.right.failed.button'),
|
text: t(
|
||||||
|
'content.editAttachment.header.right.failed.button'
|
||||||
|
),
|
||||||
style: 'cancel'
|
style: 'cancel'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Reference in New Issue
Block a user