From 1b2d9d144f64b624b1820414c0ee91fd1a89c10e Mon Sep 17 00:00:00 2001 From: xmflsct Date: Mon, 9 Jan 2023 10:11:44 +0100 Subject: [PATCH] Fix bugs --- react-native.config.js | 9 +++++++++ src/components/Timeline/Shared/Card.tsx | 4 ++-- src/screens/Tabs/Shared/History.tsx | 4 ++-- src/utils/queryHooks/index.ts | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 react-native.config.js diff --git a/react-native.config.js b/react-native.config.js new file mode 100644 index 00000000..541747c5 --- /dev/null +++ b/react-native.config.js @@ -0,0 +1,9 @@ +module.exports = { + dependencies: { + '@react-native-firebase/app': { + platforms: { + ios: null + } + } + } +} diff --git a/src/components/Timeline/Shared/Card.tsx b/src/components/Timeline/Shared/Card.tsx index 12a065f3..c92cb715 100644 --- a/src/components/Timeline/Shared/Card.tsx +++ b/src/components/Timeline/Shared/Card.tsx @@ -30,7 +30,7 @@ const TimelineCard: React.FC = () => { const statusQuery = useStatusQuery({ status: match?.status ? { ...match.status, uri: status.card.url } : undefined, - options: { enabled: false } + options: { enabled: false, retry: 1 } }) useEffect(() => { if (match?.status) { @@ -47,7 +47,7 @@ const TimelineCard: React.FC = () => { const accountQuery = useAccountQuery({ account: match?.account ? { ...match?.account, url: status.card.url } : undefined, - options: { enabled: false } + options: { enabled: false, retry: 1 } }) useEffect(() => { if (match?.account) { diff --git a/src/screens/Tabs/Shared/History.tsx b/src/screens/Tabs/Shared/History.tsx index adcfb96f..13c80fb1 100644 --- a/src/screens/Tabs/Shared/History.tsx +++ b/src/screens/Tabs/Shared/History.tsx @@ -53,10 +53,10 @@ const ContentView: React.FC<{ const changesPoll = item.poll ? item.poll.options.map((option, index) => withoutBoundary - ? prevItem?.poll?.options[index].title + ? prevItem?.poll?.options[index]?.title ? diffChars(prevItem?.poll?.options[index].title, option.title) : undefined - : prevItem?.poll?.options[index].title + : prevItem?.poll?.options[index]?.title ? diffWords(prevItem?.poll?.options[index].title, option.title) : undefined ) diff --git a/src/utils/queryHooks/index.ts b/src/utils/queryHooks/index.ts index f8b41f05..2120a922 100644 --- a/src/utils/queryHooks/index.ts +++ b/src/utils/queryHooks/index.ts @@ -8,7 +8,7 @@ export const queryClient = new QueryClient({ if ([401, 404].includes(error?.status)) { return false } - if (failureCount <= 3) { + if (failureCount <= 2) { return true } else { return false