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