mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-22 15:19:11 +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) {
|
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
|
// check if address exists in db and add if it does not
|
||||||
if (await isar.addresses
|
if (address == null) {
|
||||||
.where()
|
|
||||||
.valueEqualTo(data.item4!.value)
|
|
||||||
.findFirst() ==
|
|
||||||
null) {
|
|
||||||
await isar.addresses.put(data.item4!);
|
await isar.addresses.put(data.item4!);
|
||||||
}
|
}
|
||||||
|
|
||||||
// link and save address
|
// link and save address
|
||||||
tx.address.value = data.item4;
|
tx.address.value = address ?? data.item4!;
|
||||||
await tx.address.save();
|
await tx.address.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue