mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-09 12:19:24 +00:00
addressbook filter coins list fix
This commit is contained in:
parent
d4b7ec0f17
commit
4d17c1db5f
3 changed files with 9 additions and 8 deletions
|
@ -51,8 +51,7 @@ class _AddressBookViewState extends ConsumerState<AddressBookView> {
|
|||
ref.refresh(addressBookFilterProvider);
|
||||
|
||||
if (widget.coin == null) {
|
||||
List<Coin> coins =
|
||||
Coin.values.where((e) => !(e == Coin.epicCash)).toList();
|
||||
List<Coin> coins = Coin.values.toList();
|
||||
coins.remove(Coin.firoTestNet);
|
||||
|
||||
bool showTestNet = ref.read(prefsChangeNotifierProvider).showTestNetCoins;
|
||||
|
@ -60,8 +59,9 @@ class _AddressBookViewState extends ConsumerState<AddressBookView> {
|
|||
if (showTestNet) {
|
||||
ref.read(addressBookFilterProvider).addAll(coins, false);
|
||||
} else {
|
||||
ref.read(addressBookFilterProvider).addAll(
|
||||
coins.getRange(0, coins.length - kTestNetCoinCount + 1), false);
|
||||
ref
|
||||
.read(addressBookFilterProvider)
|
||||
.addAll(coins.getRange(0, coins.length - kTestNetCoinCount), false);
|
||||
}
|
||||
} else {
|
||||
ref.read(addressBookFilterProvider).add(widget.coin!, false);
|
||||
|
|
|
@ -38,7 +38,7 @@ class _AddressBookFilterViewState extends ConsumerState<AddressBookFilterView> {
|
|||
} else {
|
||||
_coins = coins
|
||||
.toList(growable: false)
|
||||
.getRange(0, coins.length - kTestNetCoinCount + 1)
|
||||
.getRange(0, coins.length - kTestNetCoinCount)
|
||||
.toList(growable: false);
|
||||
}
|
||||
super.initState();
|
||||
|
|
|
@ -84,7 +84,7 @@ class _DesktopAddressBook extends ConsumerState<DesktopAddressBook> {
|
|||
ref.refresh(addressBookFilterProvider);
|
||||
|
||||
// if (widget.coin == null) {
|
||||
List<Coin> coins = Coin.values.where((e) => !(e == Coin.epicCash)).toList();
|
||||
List<Coin> coins = Coin.values.toList();
|
||||
coins.remove(Coin.firoTestNet);
|
||||
|
||||
bool showTestNet = ref.read(prefsChangeNotifierProvider).showTestNetCoins;
|
||||
|
@ -92,8 +92,9 @@ class _DesktopAddressBook extends ConsumerState<DesktopAddressBook> {
|
|||
if (showTestNet) {
|
||||
ref.read(addressBookFilterProvider).addAll(coins, false);
|
||||
} else {
|
||||
ref.read(addressBookFilterProvider).addAll(
|
||||
coins.getRange(0, coins.length - kTestNetCoinCount + 1), false);
|
||||
ref
|
||||
.read(addressBookFilterProvider)
|
||||
.addAll(coins.getRange(0, coins.length - kTestNetCoinCount), false);
|
||||
}
|
||||
// } else {
|
||||
// ref.read(addressBookFilterProvider).add(widget.coin!, false);
|
||||
|
|
Loading…
Reference in a new issue