mirror of
https://github.com/tooot-app/app
synced 2025-04-28 00:48:50 +02:00
Fix account moved crash
When the account info was undefined, it may render fewer hooks
This commit is contained in:
parent
927e7df4e9
commit
ac293f28c1
@ -5,8 +5,7 @@ import { useNavigation } from '@react-navigation/native'
|
|||||||
import { useRelationshipQuery } from '@utils/queryHooks/relationship'
|
import { useRelationshipQuery } from '@utils/queryHooks/relationship'
|
||||||
import {
|
import {
|
||||||
getInstanceAccount,
|
getInstanceAccount,
|
||||||
getInstancePush,
|
getInstancePush
|
||||||
getInstanceUri
|
|
||||||
} from '@utils/slices/instancesSlice'
|
} from '@utils/slices/instancesSlice'
|
||||||
import { StyleConstants } from '@utils/styles/constants'
|
import { StyleConstants } from '@utils/styles/constants'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
@ -41,6 +40,10 @@ const Conversation = ({ account }: { account: Mastodon.Account }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const AccountInformationActions: React.FC<Props> = ({ account, myInfo }) => {
|
const AccountInformationActions: React.FC<Props> = ({ account, myInfo }) => {
|
||||||
|
if (!account) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
const { t } = useTranslation('screenTabs')
|
const { t } = useTranslation('screenTabs')
|
||||||
const navigation = useNavigation()
|
const navigation = useNavigation()
|
||||||
|
|
||||||
@ -65,7 +68,6 @@ const AccountInformationActions: React.FC<Props> = ({ account, myInfo }) => {
|
|||||||
getInstancePush,
|
getInstancePush,
|
||||||
(prev, next) => prev?.global.value === next?.global.value
|
(prev, next) => prev?.global.value === next?.global.value
|
||||||
)
|
)
|
||||||
const instanceUri = useSelector(getInstanceUri)
|
|
||||||
|
|
||||||
if (myInfo) {
|
if (myInfo) {
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user