correct address for utxo card

This commit is contained in:
julian 2023-03-06 14:47:14 -06:00
parent 3cad15652e
commit c70a8f415c

View file

@ -46,22 +46,11 @@ class _UtxoCardState extends ConsumerState<UtxoCard> {
final coin = ref.watch(walletsChangeNotifierProvider final coin = ref.watch(walletsChangeNotifierProvider
.select((value) => value.getManager(widget.walletId).coin)); .select((value) => value.getManager(widget.walletId).coin));
final addr = MainDB.instance.isar.transactions
.where()
.txidWalletIdEqualTo(
utxo.txid,
widget.walletId,
)
.findFirstSync()
?.address
.value
?.value;
String? label; String? label;
if (addr != null) { if (utxo.address != null) {
label = MainDB.instance.isar.addressLabels label = MainDB.instance.isar.addressLabels
.where() .where()
.addressStringWalletIdEqualTo(addr, widget.walletId) .addressStringWalletIdEqualTo(utxo.address!, widget.walletId)
.findFirstSync() .findFirstSync()
?.value; ?.value;
} }
@ -100,7 +89,7 @@ class _UtxoCardState extends ConsumerState<UtxoCard> {
children: [ children: [
Flexible( Flexible(
child: Text( child: Text(
label ?? addr ?? utxo.txid, label ?? utxo.address ?? utxo.txid,
style: STextStyles.w500_12(context).copyWith( style: STextStyles.w500_12(context).copyWith(
color: Theme.of(context) color: Theme.of(context)
.extension<StackColors>()! .extension<StackColors>()!