Cw 805 fix bch refund address (#1782)

* fix bch address format for exolix, stealth, thorchain, simpleswap

* exclude SP and MWEB from the exchange address book

* address pr review comments
This commit is contained in:
Serhii
2024-11-05 11:33:24 +02:00
committed by GitHub
parent b8ffd47f06
commit 459f0d352d
6 changed files with 32 additions and 18 deletions
@@ -99,18 +99,23 @@ abstract class ContactListViewModelBase with Store {
Future<void> delete(ContactRecord contact) async => contact.original.delete();
@computed
List<ContactRecord> get contactsToShow =>
contacts.where((element) => _isValidForCurrency(element)).toList();
ObservableList<ContactRecord> get contactsToShow =>
ObservableList.of(contacts.where((element) => _isValidForCurrency(element)));
@computed
List<WalletContact> get walletContactsToShow =>
walletContacts.where((element) => _isValidForCurrency(element)).toList();
bool _isValidForCurrency(ContactBase element) {
if (element.name.contains('Silent Payments')) return false;
if (element.name.contains('MWEB')) return false;
return _currency == null ||
element.type == _currency ||
element.type.title == _currency!.tag ||
element.type.tag == _currency!.tag;
(element.type.tag != null &&
_currency?.tag != null &&
element.type.tag == _currency?.tag) ||
_currency?.toString() == element.type.tag ||
_currency?.tag == element.type.toString();
}
}