Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

make getAllPeers async

Sahil Yeole26982787ee64
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<ConnectionPage>
connect(context, id, isFileTransfer: isFileTransfer);
}
- void getAllPeers(){
- peers.clear();
- Map<String, dynamic> recentPeers = jsonDecode(bind.mainLoadRecentPeersSync());
- Map<String, dynamic> favPeers = jsonDecode(bind.mainLoadFavPeersSync());
- Map<String, dynamic> lanPeers = jsonDecode(bind.mainLoadLanPeersSync());
- Map<String, dynamic> abPeers = jsonDecode(bind.mainLoadAbSync());
- Map<String, dynamic> groupPeers = jsonDecode(bind.mainLoadGroupSync());
+ Future<void> getAllPeers() async {
+ peers.clear();
+ Map<String, dynamic> recentPeers = jsonDecode(await bind.mainLoadRecentPeersSync());
+ Map<String, dynamic> favPeers = jsonDecode(await bind.mainLoadFavPeersSync());
+ Map<String, dynamic> lanPeers = jsonDecode(await bind.mainLoadLanPeersSync());
+ Map<String, dynamic> abPeers = jsonDecode(await bind.mainLoadAbSync());
+ Map<String, dynamic> groupPeers = jsonDecode(await bind.mainLoadGroupSync());
Map<String, dynamic> combinedPeers = {};
@@ -170,7 +170,7 @@ class _ConnectionPageState extends State<ConnectionPage>
try {
peerData = jsonDecode(peerData);
} catch (e) {
- print("Error decoding peers: $e");
+ debugPrint("Error decoding peers: $e");
return;
}
}