1
0
mirror of https://github.com/tooot-app/app synced 2025-04-16 11:17:29 +02:00

Fix accounts array empty not init

This commit is contained in:
xmflsct 2023-01-11 22:18:02 +01:00
parent 30be3cdb15
commit 76d4bc754b
2 changed files with 3 additions and 3 deletions

View File

@ -184,7 +184,7 @@ const ComponentInstance: React.FC<Props> = ({
)
if (!account) {
setGlobalStorage('accounts', accounts?.concat([accountKey]))
setGlobalStorage('accounts', (accounts || []).concat([accountKey]))
}
setAccount(accountKey)

View File

@ -7,8 +7,8 @@ import { useTranslation } from 'react-i18next'
import { View } from 'react-native'
const ComposePostingAs = () => {
const accounts = useGlobalStorage.object('accounts')
if (!accounts.length) return null
const [accounts] = useGlobalStorage.object('accounts')
if (!accounts?.length) return null
const { t } = useTranslation('screenCompose')
const { colors } = useTheme()