From 5ec37333694f34217104cbfa643a7a8287cac638 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Fri, 31 Dec 2021 11:38:21 +0100 Subject: [PATCH 1/5] Use correct error code --- src/utils/push/useConnect.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/push/useConnect.ts b/src/utils/push/useConnect.ts index e0ef63fb..08c30f00 100644 --- a/src/utils/push/useConnect.ts +++ b/src/utils/push/useConnect.ts @@ -29,7 +29,7 @@ const pushUseConnect = ({ mode, t, instances, dispatch }: Params) => { url: `push/connect/${expoToken}`, sentry: true }).catch(error => { - if (error.status == 410) { + if (error.status == 404) { displayMessage({ mode, type: 'error', From 248238dda8ef08396dd717e07b443d3fd18ae48b Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Fri, 31 Dec 2021 12:09:03 +0100 Subject: [PATCH 2/5] Try to fix scrollToIndex out of range --- src/screens/Tabs/Shared/Toot.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/screens/Tabs/Shared/Toot.tsx b/src/screens/Tabs/Shared/Toot.tsx index 825cbff3..94a77a99 100644 --- a/src/screens/Tabs/Shared/Toot.tsx +++ b/src/screens/Tabs/Shared/Toot.tsx @@ -38,12 +38,13 @@ const TabSharedToot: React.FC> = ({ if (!scrolled.current) { scrolled.current = true const pointer = findIndex(flattenData, ['id', toot.id]) - setTimeout(() => { - flRef.current?.scrollToIndex({ - index: pointer === -1 ? 0 : pointer, - viewOffset: 100 - }) - }, 500) + pointer > 0 && + setTimeout(() => { + flRef.current?.scrollToIndex({ + index: pointer, + viewOffset: 100 + }) + }, 1000) } } }) From d5ea813ebe27e6c4204d30e38c2279e3ae12f036 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Fri, 31 Dec 2021 12:26:17 +0100 Subject: [PATCH 3/5] Fix err may be undefined --- src/screens/Compose/utils/post.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/screens/Compose/utils/post.ts b/src/screens/Compose/utils/post.ts index d482493e..9be1334c 100644 --- a/src/screens/Compose/utils/post.ts +++ b/src/screens/Compose/utils/post.ts @@ -15,8 +15,8 @@ const composePost = async ( method: 'get', url: `statuses/${composeState.replyToStatus.id}` }) - } catch (err) { - if (err.status && err.status == 404) { + } catch (err: any) { + if (err && err.status && err.status == 404) { return Promise.reject({ removeReply: true }) } } From b3a3c677750f4c20912b40dbcf9d31f0f0905d23 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Fri, 31 Dec 2021 12:26:58 +0100 Subject: [PATCH 4/5] Fix bugs --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a84b9fb8..184bcccd 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "native": "211218", "major": 3, "minor": 0, - "patch": 0, + "patch": 1, "expo": "44.0.0" }, "description": "tooot app for Mastodon", From b08e24e23358debcb21fd949ff2c4b6585a0df92 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Fri, 31 Dec 2021 12:29:41 +0100 Subject: [PATCH 5/5] Fix page margin --- src/screens/Tabs/Me/Root.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/screens/Tabs/Me/Root.tsx b/src/screens/Tabs/Me/Root.tsx index 5da98fe8..f6bfeb49 100644 --- a/src/screens/Tabs/Me/Root.tsx +++ b/src/screens/Tabs/Me/Root.tsx @@ -11,6 +11,7 @@ import accountInitialState from '@screens/Tabs/Shared/Account/utils/initialState import accountReducer from '@screens/Tabs/Shared/Account/utils/reducer' import { useProfileQuery } from '@utils/queryHooks/profile' import { getInstanceActive } from '@utils/slices/instancesSlice' +import { StyleConstants } from '@utils/styles/constants' import React, { useReducer, useRef } from 'react' import Animated, { useAnimatedScrollHandler, @@ -49,6 +50,7 @@ const TabMeRoot: React.FC = () => { keyboardShouldPersistTaps='handled' onScroll={onScroll} scrollEventThrottle={16} + style={{ marginBottom: StyleConstants.Spacing.L }} > {instanceActive !== -1 ? (