mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-02-02 11:16:26 +00:00
Allow contacts and wallets from the same tag
This commit is contained in:
parent
9b67db0132
commit
78adf4a5ce
2 changed files with 11 additions and 5 deletions
|
@ -609,7 +609,6 @@ abstract class SettingsStoreBase with Store {
|
|||
if (Platform.isAndroid) {
|
||||
final androidInfo = await deviceInfoPlugin.androidInfo;
|
||||
deviceName = '${androidInfo.brand}%20${androidInfo.manufacturer}%20${androidInfo.model}';
|
||||
print(deviceName);
|
||||
} else if (Platform.isIOS) {
|
||||
final iosInfo = await deviceInfoPlugin.iosInfo;
|
||||
deviceName = iosInfo.model;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'dart:async';
|
||||
import 'package:cake_wallet/entities/contact_base.dart';
|
||||
import 'package:cake_wallet/entities/wallet_contact.dart';
|
||||
import 'package:cw_core/wallet_info.dart';
|
||||
import 'package:cw_core/wallet_type.dart';
|
||||
|
@ -48,10 +49,16 @@ abstract class ContactListViewModelBase with Store {
|
|||
Future<void> delete(ContactRecord contact) async => contact.original.delete();
|
||||
|
||||
@computed
|
||||
List<ContactRecord> get contactsToShow =>
|
||||
contacts.where((element) => _currency == null || element.type == _currency).toList();
|
||||
List<ContactRecord> get contactsToShow => contacts
|
||||
.where((element) => _isValidForCurrency(element))
|
||||
.toList();
|
||||
|
||||
@computed
|
||||
List<WalletContact> get walletContactsToShow =>
|
||||
walletContacts.where((element) => _currency == null || element.type == _currency).toList();
|
||||
List<WalletContact> get walletContactsToShow => walletContacts
|
||||
.where((element) => _isValidForCurrency(element))
|
||||
.toList();
|
||||
|
||||
bool _isValidForCurrency(ContactBase element) {
|
||||
return _currency == null || element.type == _currency || element.type.title == _currency!.tag;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue