diff --git a/flutter/lib/desktop/pages/connection_page.dart b/flutter/lib/desktop/pages/connection_page.dart index 0e43b7ba4..1f221aa5e 100644 --- a/flutter/lib/desktop/pages/connection_page.dart +++ b/flutter/lib/desktop/pages/connection_page.dart @@ -152,13 +152,13 @@ class _ConnectionPageState extends State connect(context, id, isFileTransfer: isFileTransfer); } - void getAllPeers(){ - peers.clear(); - Map recentPeers = jsonDecode(bind.mainLoadRecentPeersSync()); - Map favPeers = jsonDecode(bind.mainLoadFavPeersSync()); - Map lanPeers = jsonDecode(bind.mainLoadLanPeersSync()); - Map abPeers = jsonDecode(bind.mainLoadAbSync()); - Map groupPeers = jsonDecode(bind.mainLoadGroupSync()); + Future getAllPeers() async { + peers.clear(); + 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()); Map combinedPeers = {}; @@ -170,7 +170,7 @@ class _ConnectionPageState extends State try { peerData = jsonDecode(peerData); } catch (e) { - print("Error decoding peers: $e"); + debugPrint("Error decoding peers: $e"); return; } }