mirror of
				https://github.com/tooot-app/app
				synced 2025-06-05 22:19:13 +02:00 
			
		
		
		
	Fix account moved crash
When the account info was undefined, it may render fewer hooks
This commit is contained in:
		| @@ -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 ( | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user