From 9e0e8db82a4daa995ee154c82a68cb9a97bf5eb3 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sun, 8 Jan 2023 12:21:38 +0100 Subject: [PATCH 1/8] Fix Android start up crash Maybe then we can run it in BrowserStack --- src/utils/startup/timezone.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/startup/timezone.ts b/src/utils/startup/timezone.ts index d0a8f439..b1f0115f 100644 --- a/src/utils/startup/timezone.ts +++ b/src/utils/startup/timezone.ts @@ -4,8 +4,10 @@ import log from './log' const timezone = () => { log('log', 'Timezone', Localization.getCalendars()[0].timeZone || 'unknown') if ('__setDefaultTimeZone' in Intl.DateTimeFormat) { - // @ts-ignore - Intl.DateTimeFormat.__setDefaultTimeZone(Localization.getCalendars()[0].timeZone) + try { + // @ts-ignore + Intl.DateTimeFormat.__setDefaultTimeZone(Intl.DateTimeFormat.__setDefaultTimeZone('xxx')) + } catch {} } } From 6ce78e94f8e1b48f974edf9a31f1df02642445d0 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sun, 8 Jan 2023 16:59:35 +0100 Subject: [PATCH 2/8] Fix #271 Added follow as menu option --- src/components/AccountButton.tsx | 26 +-- src/components/Button.tsx | 4 +- src/components/Message.tsx | 2 +- src/components/Timeline/Default.tsx | 48 ++++- src/components/Timeline/Notifications.tsx | 43 +++- src/components/Timeline/Shared/Actions.tsx | 3 +- .../Timeline/Shared/HeaderAndroid.tsx | 51 ++++- .../Timeline/Shared/HeaderDefault.tsx | 51 ++++- .../Timeline/Shared/HeaderNotification.tsx | 50 ++++- src/components/contextMenu/account.ts | 196 +++++++++++++----- src/components/contextMenu/at.ts | 80 +++---- src/components/contextMenu/index.d.ts | 53 ++++- src/components/contextMenu/instance.ts | 7 +- src/components/contextMenu/share.ts | 10 +- src/components/contextMenu/status.ts | 19 +- src/i18n/en/components/contextMenu.json | 7 + src/screens/AccountSelection.tsx | 36 ++-- src/screens/Tabs/Me/Switch.tsx | 21 +- .../Shared/Account/Information/Actions.tsx | 41 +++- src/screens/Tabs/Shared/Account/index.tsx | 48 ++++- src/utils/api/general.ts | 6 +- src/utils/api/instance.ts | 9 +- src/utils/api/tooot.ts | 2 +- src/utils/startup/log.ts | 4 +- src/utils/storage/actions.ts | 35 ++++ 25 files changed, 611 insertions(+), 241 deletions(-) diff --git a/src/components/AccountButton.tsx b/src/components/AccountButton.tsx index ff3e497f..187169fc 100644 --- a/src/components/AccountButton.tsx +++ b/src/components/AccountButton.tsx @@ -1,44 +1,30 @@ import { useNavigation } from '@react-navigation/native' -import { generateAccountKey, getAccountDetails, setAccount } from '@utils/storage/actions' -import { StorageGlobal } from '@utils/storage/global' +import { ReadableAccountType, setAccount } from '@utils/storage/actions' import { StyleConstants } from '@utils/styles/constants' import React from 'react' import Button from './Button' import haptics from './haptics' interface Props { - account: NonNullable[number] - selected?: boolean + account: ReadableAccountType additionalActions?: () => void } -const AccountButton: React.FC = ({ account, selected = false, additionalActions }) => { +const AccountButton: React.FC = ({ account, additionalActions }) => { const navigation = useNavigation() - const accountDetails = getAccountDetails( - ['auth.domain', 'auth.account.acct', 'auth.account.domain', 'auth.account.id'], - account - ) - if (!accountDetails) return null return (