diff --git a/src/routes/bitcoin_wallet/add.rs b/src/routes/bitcoin_wallet/add.rs index e99616f..41e12d5 100644 --- a/src/routes/bitcoin_wallet/add.rs +++ b/src/routes/bitcoin_wallet/add.rs @@ -395,6 +395,16 @@ impl Page { .sort_by_key(|(_, pubkeys, _)| pubkeys.len()); federation_data_sorted_by_recommendations.reverse(); + // Filter out federations that we're already connected to. + if let Loadable::Loaded(wallet_view) = &self.connected_state.loadable_wallet_view { + let connected_federation_ids = + wallet_view.federations.keys().collect::>(); + + federation_data_sorted_by_recommendations.retain(|(federation_id, _, _)| { + !connected_federation_ids.contains(federation_id) + }); + } + for (federation_id, pubkeys, invite_codes) in federation_data_sorted_by_recommendations {