mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-12 09:27:01 +00:00
handle deleted wallets cleanly in the overview list
This commit is contained in:
parent
d6c609fea4
commit
810f8bb3c5
1 changed files with 10 additions and 0 deletions
|
@ -72,6 +72,16 @@ class _EthWalletsOverviewState extends ConsumerState<WalletsOverview> {
|
|||
final Map<String, WalletListItemData> wallets = {};
|
||||
|
||||
List<WalletListItemData> _filter(String searchTerm) {
|
||||
// clean out deleted wallets
|
||||
final existingWalletIds = ref
|
||||
.read(mainDBProvider)
|
||||
.isar
|
||||
.walletInfo
|
||||
.where()
|
||||
.walletIdProperty()
|
||||
.findAllSync();
|
||||
wallets.removeWhere((k, v) => !existingWalletIds.contains(k));
|
||||
|
||||
if (searchTerm.isEmpty) {
|
||||
return wallets.values.toList()
|
||||
..sort((a, b) => a.wallet.info.name.compareTo(b.wallet.info.name));
|
||||
|
|
Loading…
Reference in a new issue