Skip to content

Commit

Permalink
handle deleted wallets cleanly in the overview list
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-CStack committed Jul 31, 2024
1 parent d6c609f commit 810f8bb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/pages/wallets_view/wallets_overview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 810f8bb

Please sign in to comment.