mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-27 23:19:02 +08:00
Merge pull request #5442 from 21pages/ab
restore online status after pullAb
This commit is contained in:
commit
535e1bd2ce
@ -93,6 +93,8 @@ class AbModel {
|
||||
} catch (e) {}
|
||||
final data = jsonDecode(json['data']);
|
||||
if (data != null) {
|
||||
final oldOnlineIDs =
|
||||
peers.where((e) => e.online).map((e) => e.id).toList();
|
||||
tags.clear();
|
||||
peers.clear();
|
||||
if (data['tags'] is List) {
|
||||
@ -106,6 +108,11 @@ class AbModel {
|
||||
if (isFull(false)) {
|
||||
peers.removeRange(licensedDevices, peers.length);
|
||||
}
|
||||
// restore online
|
||||
peers
|
||||
.where((e) => oldOnlineIDs.contains(e.id))
|
||||
.map((e) => e.online = true)
|
||||
.toList();
|
||||
_saveCache(); // save on success
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user