Fix crashes

This commit is contained in:
xmflsct 2023-01-30 12:55:35 +01:00
parent 5551cd0e12
commit 57efc4c868
5 changed files with 7 additions and 7 deletions

View File

@ -15,8 +15,8 @@ const TimelineFullConversation = () => {
return queryKey &&
queryKey[1].page !== 'Toot' &&
status.in_reply_to_account_id &&
(status.mentions.length === 0 ||
status.mentions.filter(mention => mention.id !== status.in_reply_to_account_id).length) ? (
(status.mentions?.length === 0 ||
status.mentions?.filter(mention => mention.id !== status.in_reply_to_account_id).length) ? (
<CustomText
fontStyle='S'
style={{

View File

@ -22,7 +22,7 @@ const HeaderSharedReplies: React.FC = () => {
excludeMentions &&
(excludeMentions.current =
mentionsBeginning?.length && status?.mentions
? status.mentions.filter(mention => mentionsBeginning.includes(`@${mention.username}`))
? status.mentions?.filter(mention => mentionsBeginning.includes(`@${mention.username}`))
: [])
return excludeMentions?.current.length ? (

View File

@ -197,7 +197,7 @@ const menuStatus = ({
hidden:
!ownAccount &&
queryKey[1].page !== 'Notifications' &&
!status.mentions.find(
!status.mentions?.find(
mention => mention.acct === accountAcct && mention.username === accountAcct
) &&
!status.muted

View File

@ -96,10 +96,10 @@ const Collections: React.FC = () => {
iconBack='chevron-right'
title={t('screenTabs:me.stacks.push.name')}
content={
typeof instancePush.global === 'boolean'
typeof instancePush?.global === 'boolean'
? t('screenTabs:me.root.push.content', {
defaultValue: 'false',
context: instancePush.global.toString()
context: instancePush?.global.toString()
})
: undefined
}

View File

@ -19,5 +19,5 @@ export const appendRemote = {
_remote: true
}),
mentions: (mentions: Mastodon.Mention[]) =>
mentions.map(mention => ({ ...mention, _remote: true }))
mentions?.map(mention => ({ ...mention, _remote: true }))
}