Skip to content

Commit

Permalink
use get default persona
Browse files Browse the repository at this point in the history
Signed-off-by: phuoc <phuoc@bitmark.com>
  • Loading branch information
phuocbitmark committed Jul 16, 2024
1 parent 3c3eb32 commit b5ba6f7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/screen/irl_screen/webview_irl_screen.dart
Original file line number Diff line number Diff line change
@@ -169,9 +169,15 @@ class _IRLWebScreenState extends State<IRLWebScreen> {
.addressDao
.getAddressesByType(cryptoType.source);
if (addresses.isEmpty) {
final persona =
await injector<AccountService>().getOrCreateDefaultPersona();
await persona.insertNextAddress(cryptoType == CryptoType.XTZ
final personas =
await injector<CloudDatabase>().personaDao.getDefaultPersonas();
if (personas.isEmpty) {
return _logAndReturnJSResult(
'_countAddress',
JSResult.error('Account not found'),
);
}
await personas.first.insertNextAddress(cryptoType == CryptoType.XTZ
? WalletType.Tezos
: WalletType.Ethereum);
return _logAndReturnJSResult(

0 comments on commit b5ba6f7

Please sign in to comment.