From ac293f28c1e4fa006f2e048cd8d77e6908b1a6f8 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Wed, 7 Jul 2021 17:19:13 +0200 Subject: [PATCH 1/2] Fix account moved crash When the account info was undefined, it may render fewer hooks --- src/screens/Tabs/Shared/Account/Information/Actions.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/screens/Tabs/Shared/Account/Information/Actions.tsx b/src/screens/Tabs/Shared/Account/Information/Actions.tsx index f8ebb9c2..bc3cb9f9 100644 --- a/src/screens/Tabs/Shared/Account/Information/Actions.tsx +++ b/src/screens/Tabs/Shared/Account/Information/Actions.tsx @@ -5,8 +5,7 @@ import { useNavigation } from '@react-navigation/native' import { useRelationshipQuery } from '@utils/queryHooks/relationship' import { getInstanceAccount, - getInstancePush, - getInstanceUri + getInstancePush } from '@utils/slices/instancesSlice' import { StyleConstants } from '@utils/styles/constants' import React from 'react' @@ -41,6 +40,10 @@ const Conversation = ({ account }: { account: Mastodon.Account }) => { } const AccountInformationActions: React.FC = ({ account, myInfo }) => { + if (!account) { + return null + } + const { t } = useTranslation('screenTabs') const navigation = useNavigation() @@ -65,7 +68,6 @@ const AccountInformationActions: React.FC = ({ account, myInfo }) => { getInstancePush, (prev, next) => prev?.global.value === next?.global.value ) - const instanceUri = useSelector(getInstanceUri) if (myInfo) { return ( From 6488a8f7bd7bcfd52cbc99b571d23eb1366b4b57 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Wed, 7 Jul 2021 17:33:54 +0200 Subject: [PATCH 2/2] Small fixes --- package.json | 2 +- src/components/Timeline/Default.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 103cb6b0..e26c7b54 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "native": "210511", "major": 2, "minor": 1, - "patch": 0, + "patch": 1, "expo": "41.0.0" }, "description": "tooot app for Mastodon", diff --git a/src/components/Timeline/Default.tsx b/src/components/Timeline/Default.tsx index 9dc90ae4..36260389 100644 --- a/src/components/Timeline/Default.tsx +++ b/src/components/Timeline/Default.tsx @@ -49,7 +49,7 @@ const TimelineDefault: React.FC = ({ StackNavigationProp >() - let actualStatus = item.reblog ? item.reblog : item + const actualStatus = item.reblog ? item.reblog : item const ownAccount = actualStatus.account.id === instanceAccount?.id