mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-06-07 09:52:49 +08:00
clear the accessible devices tab when retrieving accessible devices is disabled
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
parent
4e1a814aeb
commit
e2ed4d122e
@ -47,7 +47,10 @@ class GroupModel {
|
||||
}
|
||||
try {
|
||||
await _pull();
|
||||
} catch (_) {}
|
||||
_tryHandlePullError();
|
||||
} catch (e) {
|
||||
print("pull accessibles error: $e");
|
||||
}
|
||||
groupLoading.value = false;
|
||||
initialized = true;
|
||||
platformFFI.tryHandle({'name': LoadEvent.group});
|
||||
@ -361,4 +364,15 @@ class GroupModel {
|
||||
void removePeerUpdateListener(String key) {
|
||||
_peerIdUpdateListeners.remove(key);
|
||||
}
|
||||
|
||||
void _tryHandlePullError() {
|
||||
String errorMessage = groupLoadError.value;
|
||||
// The error message is "Retrieving accessible devices is disabled."
|
||||
if (errorMessage.toLowerCase().contains('retrieving accessible') ||
|
||||
errorMessage.toLowerCase().contains('disabled')) {
|
||||
users.clear();
|
||||
peers.clear();
|
||||
deviceGroups.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user