fix lan peers batch deletion (#8715)
`peers.map((p) async {})` is not sync and peers are loaded before deletion. ``` let mut peers = config::LanPeers::load().peers; peers.retain(|x| x.id != id); ``` Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
parent
e2a7e38a39
commit
8512c2b2b0
@ -399,9 +399,9 @@ class _PeerTabPageState extends State<PeerTabPage>
|
||||
final peers = model.selectedPeers;
|
||||
switch (model.currentTab) {
|
||||
case 0:
|
||||
peers.map((p) async {
|
||||
for (var p in peers) {
|
||||
await bind.mainRemovePeer(id: p.id);
|
||||
}).toList();
|
||||
}
|
||||
await bind.mainLoadRecentPeers();
|
||||
break;
|
||||
case 1:
|
||||
@ -413,9 +413,9 @@ class _PeerTabPageState extends State<PeerTabPage>
|
||||
await bind.mainLoadFavPeers();
|
||||
break;
|
||||
case 2:
|
||||
peers.map((p) async {
|
||||
for (var p in peers) {
|
||||
await bind.mainRemoveDiscovered(id: p.id);
|
||||
}).toList();
|
||||
}
|
||||
await bind.mainLoadLanPeers();
|
||||
break;
|
||||
case 3:
|
||||
|
Loading…
x
Reference in New Issue
Block a user