mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Fix Sentry errors
This commit is contained in:
@ -31,10 +31,10 @@ const TimelineAttachment = () => {
|
||||
const account = useSelector(
|
||||
getInstanceAccount,
|
||||
(prev, next) =>
|
||||
prev.preferences['reading:expand:media'] === next.preferences['reading:expand:media']
|
||||
prev.preferences?.['reading:expand:media'] === next.preferences?.['reading:expand:media']
|
||||
)
|
||||
const defaultSensitive = () => {
|
||||
switch (account.preferences['reading:expand:media']) {
|
||||
switch (account.preferences?.['reading:expand:media']) {
|
||||
case 'show_all':
|
||||
return false
|
||||
case 'hide_all':
|
||||
|
@ -47,7 +47,7 @@ const TimelineContent: React.FC<Props> = ({ notificationOwnToot = false, setSpoi
|
||||
mentions={status.mentions}
|
||||
tags={status.tags}
|
||||
numberOfLines={
|
||||
instanceAccount.preferences['reading:expand:spoilers'] || inThread
|
||||
instanceAccount.preferences?.['reading:expand:spoilers'] || inThread
|
||||
? notificationOwnToot
|
||||
? 2
|
||||
: 999
|
||||
|
@ -65,7 +65,7 @@ const TimelineHeaderNotification: React.FC<Props> = ({ notification }) => {
|
||||
`https://${url}/admin/reports/${notification.report.id}`,
|
||||
'tooot://tooot',
|
||||
{
|
||||
browserPackage: await browserPackage(),
|
||||
...(await browserPackage()),
|
||||
dismissButtonStyle: 'done',
|
||||
readerMode: false
|
||||
}
|
||||
|
@ -7,41 +7,40 @@ import { useTranslation } from 'react-i18next'
|
||||
import { View } from 'react-native'
|
||||
|
||||
export interface Props {
|
||||
account: Mastodon.Account
|
||||
account?: Mastodon.Account
|
||||
withoutName?: boolean // For notification follow request etc.
|
||||
}
|
||||
|
||||
const HeaderSharedAccount = React.memo(
|
||||
({ account, withoutName = false }: Props) => {
|
||||
const { t } = useTranslation('componentTimeline')
|
||||
const { colors } = useTheme()
|
||||
const HeaderSharedAccount: React.FC<Props> = ({ account, withoutName = false }) => {
|
||||
if (!account) return null
|
||||
|
||||
return (
|
||||
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
||||
{withoutName ? null : (
|
||||
<CustomText
|
||||
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}
|
||||
fontBold
|
||||
/>
|
||||
</CustomText>
|
||||
)}
|
||||
const { t } = useTranslation('componentTimeline')
|
||||
const { colors } = useTheme()
|
||||
|
||||
return (
|
||||
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
||||
{withoutName ? null : (
|
||||
<CustomText
|
||||
accessibilityHint={t('shared.header.shared.account.account.accessibilityHint')}
|
||||
style={{ flexShrink: 1, color: colors.secondary }}
|
||||
accessibilityHint={t('shared.header.shared.account.name.accessibilityHint')}
|
||||
style={{ marginRight: StyleConstants.Spacing.XS }}
|
||||
numberOfLines={1}
|
||||
>
|
||||
@{account.acct}
|
||||
<ParseEmojis
|
||||
content={account.display_name || account.username}
|
||||
emojis={account.emojis}
|
||||
fontBold
|
||||
/>
|
||||
</CustomText>
|
||||
</View>
|
||||
)
|
||||
},
|
||||
() => true
|
||||
)
|
||||
)}
|
||||
<CustomText
|
||||
accessibilityHint={t('shared.header.shared.account.account.accessibilityHint')}
|
||||
style={{ flexShrink: 1, color: colors.secondary }}
|
||||
numberOfLines={1}
|
||||
>
|
||||
@{account.acct}
|
||||
</CustomText>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
export default HeaderSharedAccount
|
||||
|
Reference in New Issue
Block a user