Fix adding account bug

This commit is contained in:
xmflsct 2023-01-08 17:07:47 +01:00
parent 6ce78e94f8
commit cc6740a7c0
1 changed files with 2 additions and 2 deletions

View File

@ -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()
}