mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 03:49:22 +00:00
shared address parse fix
This commit is contained in:
parent
40af5e5206
commit
c08c3f779d
1 changed files with 8 additions and 6 deletions
|
@ -56,16 +56,18 @@ mixin WalletDB {
|
|||
}
|
||||
|
||||
if (data.item4 != null) {
|
||||
final address = await isar.addresses
|
||||
.where()
|
||||
.valueEqualTo(data.item4!.value)
|
||||
.findFirst();
|
||||
|
||||
// check if address exists in db and add if it does not
|
||||
if (await isar.addresses
|
||||
.where()
|
||||
.valueEqualTo(data.item4!.value)
|
||||
.findFirst() ==
|
||||
null) {
|
||||
if (address == null) {
|
||||
await isar.addresses.put(data.item4!);
|
||||
}
|
||||
|
||||
// link and save address
|
||||
tx.address.value = data.item4;
|
||||
tx.address.value = address ?? data.item4!;
|
||||
await tx.address.save();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue