mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-06-13 06:07:35 +08:00
opt: more error catch on address book
This commit is contained in:
parent
ef80dab48e
commit
910fb84857
@ -45,8 +45,8 @@ class AbModel with ChangeNotifier {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
abError = err.toString();
|
abError = err.toString();
|
||||||
} finally {
|
} finally {
|
||||||
notifyListeners();
|
|
||||||
abLoading = false;
|
abLoading = false;
|
||||||
|
notifyListeners();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -98,12 +98,18 @@ class AbModel with ChangeNotifier {
|
|||||||
final body = jsonEncode({
|
final body = jsonEncode({
|
||||||
"data": jsonEncode({"tags": tags, "peers": peers})
|
"data": jsonEncode({"tags": tags, "peers": peers})
|
||||||
});
|
});
|
||||||
final resp =
|
try {
|
||||||
await http.post(Uri.parse(api), headers: authHeaders, body: body);
|
final resp =
|
||||||
abLoading = false;
|
await http.post(Uri.parse(api), headers: authHeaders, body: body);
|
||||||
await getAb();
|
abError = "";
|
||||||
|
await getAb();
|
||||||
|
debugPrint("resp: ${resp.body}");
|
||||||
|
} catch (e) {
|
||||||
|
abError = e.toString();
|
||||||
|
} finally {
|
||||||
|
abLoading = false;
|
||||||
|
}
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
debugPrint("resp: ${resp.body}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool idContainBy(String id) {
|
bool idContainBy(String id) {
|
||||||
|
Loading…
Reference in New Issue
Block a user