mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Fix adding account bug
This commit is contained in:
@ -13,6 +13,7 @@ import { StorageAccount } from '@utils/storage/account'
|
|||||||
import {
|
import {
|
||||||
generateAccountKey,
|
generateAccountKey,
|
||||||
getGlobalStorage,
|
getGlobalStorage,
|
||||||
|
setAccount,
|
||||||
setAccountStorage,
|
setAccountStorage,
|
||||||
setGlobalStorage
|
setGlobalStorage
|
||||||
} from '@utils/storage/actions'
|
} from '@utils/storage/actions'
|
||||||
@ -175,12 +176,11 @@ const ComponentInstance: React.FC<Props> = ({
|
|||||||
})),
|
})),
|
||||||
accountKey
|
accountKey
|
||||||
)
|
)
|
||||||
storage.account = new MMKV({ id: accountKey })
|
|
||||||
|
|
||||||
if (!account) {
|
if (!account) {
|
||||||
setGlobalStorage('accounts', accounts?.concat([accountKey]))
|
setGlobalStorage('accounts', accounts?.concat([accountKey]))
|
||||||
}
|
}
|
||||||
setGlobalStorage('account.active', accountKey)
|
setAccount(accountKey)
|
||||||
|
|
||||||
goBack && navigation.goBack()
|
goBack && navigation.goBack()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user