diff --git a/flutter/lib/desktop/pages/connection_page.dart b/flutter/lib/desktop/pages/connection_page.dart index a19a70c99..40cb4100f 100644 --- a/flutter/lib/desktop/pages/connection_page.dart +++ b/flutter/lib/desktop/pages/connection_page.dart @@ -160,7 +160,6 @@ class _ConnectionPageState extends State Future _getAllPeers() async { Map recentPeers = jsonDecode(await bind.mainLoadRecentPeersSync()); - Map favPeers = jsonDecode(await bind.mainLoadFavPeersSync()); Map lanPeers = jsonDecode(await bind.mainLoadLanPeersSync()); Map abPeers = jsonDecode(await bind.mainLoadAbSync()); Map groupPeers = jsonDecode(await bind.mainLoadGroupSync()); @@ -194,7 +193,6 @@ class _ConnectionPageState extends State } mergePeers(recentPeers); - mergePeers(favPeers); mergePeers(lanPeers); mergePeers(abPeers); mergePeers(groupPeers); diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index 2a714d949..4636bca08 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -886,53 +886,6 @@ pub fn main_load_recent_peers_sync() -> SyncReturn { SyncReturn("".to_string()) } -pub fn main_load_fav_peers_sync() -> SyncReturn { - if !config::APP_DIR.read().unwrap().is_empty() { - let favs = get_fav(); - let mut recent = PeerConfig::peers(None); - let mut lan = config::LanPeers::load() - .peers - .iter() - .filter(|d| recent.iter().all(|r| r.0 != d.id)) - .map(|d| { - ( - d.id.clone(), - SystemTime::UNIX_EPOCH, - PeerConfig { - info: PeerInfoSerde { - username: d.username.clone(), - hostname: d.hostname.clone(), - platform: d.platform.clone(), - }, - ..Default::default() - }, - ) - }) - .collect(); - recent.append(&mut lan); - let peers: Vec> = recent - .into_iter() - .filter_map(|(id, _, p)| { - if favs.contains(&id) { - Some(peer_to_map(id, p)) - } else { - None - } - }) - .collect(); - - let data = HashMap::from([ - ("name", "load_fav_peers".to_owned()), - ( - "peers", - serde_json::ser::to_string(&peers).unwrap_or("".to_owned()), - ), - ]); - return SyncReturn(serde_json::ser::to_string(&data).unwrap_or("".to_owned())); - } - SyncReturn("".to_string()) -} - pub fn main_load_lan_peers_sync() -> SyncReturn { let data = HashMap::from([ ("name", "load_lan_peers".to_owned()),