filter by address fixes

This commit is contained in:
julian 2023-01-13 12:00:02 -06:00
parent d119296492
commit 0543c4b044
3 changed files with 4 additions and 3 deletions

View file

@ -62,7 +62,7 @@ class _ContactDetailsViewState extends ConsumerState<ContactDetailsView> {
final transactions = await manager.db.transactions final transactions = await manager.db.transactions
.filter() .filter()
.anyOf(contact.addresses.map((e) => e.address), .anyOf(contact.addresses.map((e) => e.address),
(q, String e) => q.addressEqualTo(e)) (q, String e) => q.address((q) => q.valueEqualTo(e)))
.sortByTimestampDesc() .sortByTimestampDesc()
.findAll(); .findAll();

View file

@ -4,6 +4,7 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:isar/isar.dart'; import 'package:isar/isar.dart';
import 'package:stackwallet/models/contact.dart'; import 'package:stackwallet/models/contact.dart';
import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart';
import 'package:stackwallet/models/isar/models/isar_models.dart';
import 'package:stackwallet/pages/address_book_views/subviews/add_new_contact_address_view.dart'; import 'package:stackwallet/pages/address_book_views/subviews/add_new_contact_address_view.dart';
import 'package:stackwallet/pages_desktop_specific/address_book_view/subwidgets/desktop_address_card.dart'; import 'package:stackwallet/pages_desktop_specific/address_book_view/subwidgets/desktop_address_card.dart';
import 'package:stackwallet/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_options_menu_popup.dart'; import 'package:stackwallet/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_options_menu_popup.dart';
@ -61,7 +62,7 @@ class _DesktopContactDetailsState extends ConsumerState<DesktopContactDetails> {
final transactions = await manager.db.transactions final transactions = await manager.db.transactions
.filter() .filter()
.anyOf(contact.addresses.map((e) => e.address), .anyOf(contact.addresses.map((e) => e.address),
(q, String e) => q.addressEqualTo(e)) (q, String e) => q.address((q) => q.valueEqualTo(e)))
.sortByTimestampDesc() .sortByTimestampDesc()
.findAll(); .findAll();

View file

@ -135,7 +135,7 @@ extension PayNym on DogecoinWallet {
Future<Transaction?> hasSentNotificationTx(PaymentCode pCode) async { Future<Transaction?> hasSentNotificationTx(PaymentCode pCode) async {
final tx = await isar.transactions final tx = await isar.transactions
.filter() .filter()
.addressEqualTo(pCode.notificationAddress()) .address((q) => q.valueEqualTo(pCode.notificationAddress()))
.findFirst(); .findFirst();
return tx; return tx;
} }