mirror of
https://github.com/tooot-app/app
synced 2025-02-02 11:36:56 +01:00
Fix Sentry reports
This commit is contained in:
parent
b70ca924a1
commit
cb7762d18c
@ -126,7 +126,7 @@ const renderNode = ({
|
||||
}
|
||||
}}
|
||||
>
|
||||
{(content && content !== href && content) || (showFullLink ? href : domain[1])}
|
||||
{content && content !== href ? content : showFullLink ? href : domain?.[1]}
|
||||
{!shouldBeTag ? (
|
||||
<Icon
|
||||
color={colors.blue}
|
||||
|
@ -53,10 +53,10 @@ const TimelineDefault: React.FC<Props> = ({
|
||||
const status = item.reblog ? item.reblog : item
|
||||
const ownAccount = status.account?.id === instanceAccount?.id
|
||||
const [spoilerExpanded, setSpoilerExpanded] = useState(
|
||||
instanceAccount.preferences['reading:expand:spoilers'] || false
|
||||
instanceAccount?.preferences['reading:expand:spoilers'] || false
|
||||
)
|
||||
const spoilerHidden = status.spoiler_text?.length
|
||||
? !instanceAccount.preferences['reading:expand:spoilers'] && !spoilerExpanded
|
||||
? !instanceAccount?.preferences['reading:expand:spoilers'] && !spoilerExpanded
|
||||
: false
|
||||
const copiableContent = useRef<{ content: string; complete: boolean }>({
|
||||
content: '',
|
||||
|
@ -20,23 +20,19 @@ const HeaderSharedAccount = React.memo(
|
||||
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
||||
{withoutName ? null : (
|
||||
<CustomText
|
||||
accessibilityHint={t(
|
||||
'shared.header.shared.account.name.accessibilityHint'
|
||||
)}
|
||||
accessibilityHint={t('shared.header.shared.account.name.accessibilityHint')}
|
||||
style={{ marginRight: StyleConstants.Spacing.XS }}
|
||||
numberOfLines={1}
|
||||
>
|
||||
<ParseEmojis
|
||||
content={account?.display_name || account?.username}
|
||||
emojis={account.emojis}
|
||||
emojis={account?.emojis}
|
||||
fontBold
|
||||
/>
|
||||
</CustomText>
|
||||
)}
|
||||
<CustomText
|
||||
accessibilityHint={t(
|
||||
'shared.header.shared.account.account.accessibilityHint'
|
||||
)}
|
||||
accessibilityHint={t('shared.header.shared.account.account.accessibilityHint')}
|
||||
style={{ flexShrink: 1, color: colors.secondary }}
|
||||
numberOfLines={1}
|
||||
>
|
||||
|
@ -26,10 +26,10 @@ export const uploadAttachment = async ({
|
||||
}) => {
|
||||
const hash = await Crypto.digestStringAsync(
|
||||
Crypto.CryptoDigestAlgorithm.SHA256,
|
||||
media.uri + Math.random()
|
||||
media.uri + Math.random().toString()
|
||||
)
|
||||
|
||||
switch (media.type.split('/')[0]) {
|
||||
switch (media.type?.split('/')[0] || '') {
|
||||
case 'image':
|
||||
composeDispatch({
|
||||
type: 'attachment/upload/start',
|
||||
@ -77,15 +77,11 @@ export const uploadAttachment = async ({
|
||||
payload: hash
|
||||
})
|
||||
Alert.alert(
|
||||
i18next.t(
|
||||
'screenCompose:content.root.actions.attachment.failed.alert.title'
|
||||
),
|
||||
i18next.t('screenCompose:content.root.actions.attachment.failed.alert.title'),
|
||||
message,
|
||||
[
|
||||
{
|
||||
text: i18next.t(
|
||||
'screenCompose:content.root.actions.attachment.failed.alert.button'
|
||||
),
|
||||
text: i18next.t('screenCompose:content.root.actions.attachment.failed.alert.button'),
|
||||
onPress: () => {}
|
||||
}
|
||||
]
|
||||
@ -117,9 +113,7 @@ export const uploadAttachment = async ({
|
||||
})
|
||||
.catch((err: any) => {
|
||||
uploadFailed(
|
||||
err?.message && typeof err?.message === 'string'
|
||||
? err?.message.slice(0, 50)
|
||||
: undefined
|
||||
err?.message && typeof err?.message === 'string' ? err?.message.slice(0, 50) : undefined
|
||||
)
|
||||
})
|
||||
}
|
||||
|
@ -37,25 +37,16 @@ const composePost = async (
|
||||
formData.append('poll[multiple]', composeState.poll.multiple.toString())
|
||||
}
|
||||
|
||||
if (
|
||||
composeState.attachments.uploads.filter(
|
||||
upload => upload.remote && upload.remote.id
|
||||
).length
|
||||
) {
|
||||
if (composeState.attachments.uploads.filter(upload => upload.remote && upload.remote.id).length) {
|
||||
formData.append('sensitive', composeState.attachments.sensitive.toString())
|
||||
composeState.attachments.uploads.forEach(e =>
|
||||
formData.append('media_ids[]', e.remote!.id!)
|
||||
)
|
||||
composeState.attachments.uploads.forEach(e => formData.append('media_ids[]', e.remote!.id!))
|
||||
}
|
||||
|
||||
formData.append('visibility', composeState.visibility)
|
||||
|
||||
return apiInstance<Mastodon.Status>({
|
||||
method: params?.type === 'edit' ? 'put' : 'post',
|
||||
url:
|
||||
params?.type === 'edit'
|
||||
? `statuses/${params.incomingStatus.id}`
|
||||
: 'statuses',
|
||||
url: params?.type === 'edit' ? `statuses/${params.incomingStatus.id}` : 'statuses',
|
||||
headers: {
|
||||
'Idempotency-Key': await Crypto.digestStringAsync(
|
||||
Crypto.CryptoDigestAlgorithm.SHA256,
|
||||
@ -70,9 +61,7 @@ const composePost = async (
|
||||
composeState.attachments.sensitive +
|
||||
composeState.attachments.uploads.map(upload => upload.remote?.id) +
|
||||
composeState.visibility +
|
||||
(params?.type === 'edit' || params?.type === 'deleteEdit'
|
||||
? Math.random()
|
||||
: '')
|
||||
(params?.type === 'edit' || params?.type === 'deleteEdit' ? Math.random().toString() : '')
|
||||
)
|
||||
},
|
||||
body: formData
|
||||
|
@ -3,10 +3,7 @@ import { useNavigation } from '@react-navigation/native'
|
||||
import { useAppDispatch } from '@root/store'
|
||||
import { useAnnouncementQuery } from '@utils/queryHooks/announcement'
|
||||
import { useListsQuery } from '@utils/queryHooks/lists'
|
||||
import {
|
||||
getInstanceMePage,
|
||||
updateInstanceMePage
|
||||
} from '@utils/slices/instancesSlice'
|
||||
import { getInstanceMePage, updateInstanceMePage } from '@utils/slices/instancesSlice'
|
||||
import { getInstancePush } from '@utils/slices/instancesSlice'
|
||||
import React, { useEffect } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
@ -41,19 +38,17 @@ const Collections: React.FC = () => {
|
||||
}
|
||||
})
|
||||
useEffect(() => {
|
||||
if (announcementsQuery.isSuccess) {
|
||||
if (announcementsQuery.data) {
|
||||
dispatch(
|
||||
updateInstanceMePage({
|
||||
announcements: {
|
||||
shown: announcementsQuery.data?.length ? true : false,
|
||||
unread: announcementsQuery.data?.filter(
|
||||
announcement => !announcement.read
|
||||
).length
|
||||
shown: announcementsQuery.data.length ? true : false,
|
||||
unread: announcementsQuery.data.filter(announcement => !announcement.read).length
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
}, [announcementsQuery.isSuccess, announcementsQuery.data?.length])
|
||||
}, [announcementsQuery.data])
|
||||
|
||||
const instancePush = useSelector(
|
||||
getInstancePush,
|
||||
@ -100,9 +95,7 @@ const Collections: React.FC = () => {
|
||||
})
|
||||
: t('me.root.announcements.content.read')
|
||||
}
|
||||
onPress={() =>
|
||||
navigation.navigate('Screen-Announcements', { showAll: true })
|
||||
}
|
||||
onPress={() => navigation.navigate('Screen-Announcements', { showAll: true })}
|
||||
/>
|
||||
) : null}
|
||||
<MenuRow
|
||||
|
@ -51,6 +51,8 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
|
||||
scrolled.current = true
|
||||
const pointer = flattenData.findIndex(({ id }) => id === toot.id)
|
||||
if (pointer < 1) return
|
||||
const length = flRef.current?.props.data?.length
|
||||
if (!length) return
|
||||
try {
|
||||
setTimeout(() => {
|
||||
try {
|
||||
|
@ -287,7 +287,7 @@ const instancesSlice = createSlice({
|
||||
const activeIndex = findInstanceActive(state.instances)
|
||||
state.instances[activeIndex].frequentEmojis = state.instances[
|
||||
activeIndex
|
||||
].frequentEmojis?.filter(emoji => {
|
||||
]?.frequentEmojis?.filter(emoji => {
|
||||
return action.payload?.find(
|
||||
e => e.shortcode === emoji.emoji.shortcode && e.url === emoji.emoji.url
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user