diff --git a/fastlane/Deliverfile b/fastlane/Deliverfile index d298c5fa..d6b4e3b1 100644 --- a/fastlane/Deliverfile +++ b/fastlane/Deliverfile @@ -1,6 +1,3 @@ -name({ - 'default' => "tooot" -}) keywords({ 'default' => "Mastodon,tooot,social,decentralized,长毛象,社交,去中心" }) diff --git a/fastlane/metadata/android/en-US/title.txt b/fastlane/metadata/android/en-US/title.txt new file mode 120000 index 00000000..5790022e --- /dev/null +++ b/fastlane/metadata/android/en-US/title.txt @@ -0,0 +1 @@ +../../en-US/name.txt \ No newline at end of file diff --git a/fastlane/metadata/android/zh-CN/title.txt b/fastlane/metadata/android/zh-CN/title.txt deleted file mode 100644 index bea7f0e1..00000000 --- a/fastlane/metadata/android/zh-CN/title.txt +++ /dev/null @@ -1 +0,0 @@ -tooot \ No newline at end of file diff --git a/fastlane/metadata/android/zh-CN/title.txt b/fastlane/metadata/android/zh-CN/title.txt new file mode 120000 index 00000000..b37dce9f --- /dev/null +++ b/fastlane/metadata/android/zh-CN/title.txt @@ -0,0 +1 @@ +../../zh-Hans/name.txt \ No newline at end of file diff --git a/fastlane/metadata/default/name.txt b/fastlane/metadata/default/name.txt new file mode 120000 index 00000000..13835fae --- /dev/null +++ b/fastlane/metadata/default/name.txt @@ -0,0 +1 @@ +../en-US/name.txt \ No newline at end of file diff --git a/fastlane/metadata/en-US/name.txt b/fastlane/metadata/en-US/name.txt new file mode 100644 index 00000000..7efcc4c0 --- /dev/null +++ b/fastlane/metadata/en-US/name.txt @@ -0,0 +1 @@ +tooot - multilingual Mastodon app \ No newline at end of file diff --git a/fastlane/metadata/en-US/subtitle.txt b/fastlane/metadata/en-US/subtitle.txt index 41d2c9e8..d5f3b27f 100644 --- a/fastlane/metadata/en-US/subtitle.txt +++ b/fastlane/metadata/en-US/subtitle.txt @@ -1 +1 @@ -Open source Mastodon client \ No newline at end of file +Simple, just works \ No newline at end of file diff --git a/fastlane/metadata/zh-Hans/name.txt b/fastlane/metadata/zh-Hans/name.txt new file mode 100644 index 00000000..b1ba8233 --- /dev/null +++ b/fastlane/metadata/zh-Hans/name.txt @@ -0,0 +1 @@ +tooot - 探索联邦宇宙 \ No newline at end of file diff --git a/fastlane/metadata/zh-Hans/subtitle.txt b/fastlane/metadata/zh-Hans/subtitle.txt index 8b6cf09a..59b81fb0 100644 --- a/fastlane/metadata/zh-Hans/subtitle.txt +++ b/fastlane/metadata/zh-Hans/subtitle.txt @@ -1 +1 @@ -开源毛象客户端 \ No newline at end of file +简约,想你所想 \ No newline at end of file diff --git a/package.json b/package.json index 02a977f8..291e8772 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tooot", - "version": "4.8.5", + "version": "4.8.6", "description": "tooot for Mastodon", "author": "xmflsct ", "license": "GPL-3.0-or-later", diff --git a/src/App.tsx b/src/App.tsx index c1d671e2..32072655 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,6 +2,7 @@ import { ActionSheetProvider } from '@expo/react-native-action-sheet' import * as Sentry from '@sentry/react-native' import { QueryClientProvider } from '@tanstack/react-query' import AccessibilityManager from '@utils/accessibility/AccessibilityManager' +import { connectVerify } from '@utils/api/helpers/connect' import getLanguage from '@utils/helpers/getLanguage' import { queryClient } from '@utils/queryHooks' import audio from '@utils/startup/audio' @@ -23,6 +24,10 @@ import { enableFreeze } from 'react-native-screens' import i18n from './i18n' import Screens from './screens' +export const GLOBAL: { connect?: boolean } = { + connect: undefined +} + Platform.select({ android: LogBox.ignoreLogs(['Setting a timer for a long period of time']) }) @@ -50,20 +55,29 @@ const App: React.FC = () => { await migrateFromAsyncStorage() setHasMigrated(true) } catch {} + } + + const useConnect = getGlobalStorage.boolean('app.connect') + GLOBAL.connect = useConnect + log('log', 'App', `connect: ${useConnect}`) + if (useConnect) { + await connectVerify() + .then(() => log('log', 'App', 'connected')) + .catch(() => log('warn', 'App', 'connect verify failed')) + } + + log('log', 'App', 'loading from MMKV') + const account = getGlobalStorage.string('account.active') + if (account) { + await setAccount(account) } else { - log('log', 'App', 'loading from MMKV') - const account = getGlobalStorage.string('account.active') - if (account) { - await setAccount(account) + log('log', 'App', 'No active account available') + const accounts = getGlobalStorage.object('accounts') + if (accounts?.length) { + log('log', 'App', `Setting active account ${accounts[accounts.length - 1]}`) + await setAccount(accounts[accounts.length - 1]) } else { - log('log', 'App', 'No active account available') - const accounts = getGlobalStorage.object('accounts') - if (accounts?.length) { - log('log', 'App', `Setting active account ${accounts[accounts.length - 1]}`) - await setAccount(accounts[accounts.length - 1]) - } else { - setGlobalStorage('account.active', undefined) - } + setGlobalStorage('account.active', undefined) } } diff --git a/src/components/Account.tsx b/src/components/Account.tsx index a59b51f1..da062c03 100644 --- a/src/components/Account.tsx +++ b/src/components/Account.tsx @@ -45,6 +45,7 @@ const ComponentAccount: React.FC = ({ account, props, borderRadius: 8, marginRight: StyleConstants.Spacing.S }} + dim /> diff --git a/src/components/AccountButton.tsx b/src/components/AccountButton.tsx index 187169fc..662d1b14 100644 --- a/src/components/AccountButton.tsx +++ b/src/components/AccountButton.tsx @@ -1,9 +1,13 @@ import { useNavigation } from '@react-navigation/native' import { ReadableAccountType, setAccount } from '@utils/storage/actions' import { StyleConstants } from '@utils/styles/constants' +import { useTheme } from '@utils/styles/ThemeManager' import React from 'react' -import Button from './Button' +import { Pressable } from 'react-native' +import GracefullyImage from './GracefullyImage' import haptics from './haptics' +import Icon from './Icon' +import CustomText from './Text' interface Props { account: ReadableAccountType @@ -11,26 +15,56 @@ interface Props { } const AccountButton: React.FC = ({ account, additionalActions }) => { + const { colors } = useTheme() const navigation = useNavigation() return ( -