This commit is contained in:
parent
54fe6d7bab
commit
97310e2ba9
@ -87,6 +87,11 @@ class Mount with ChangeNotifier {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (response.statusCode == 404) {
|
||||||
|
_mountList?.reset();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
await refresh();
|
await refresh();
|
||||||
|
|
||||||
if (!unmount && response.statusCode == 500) {
|
if (!unmount && response.statusCode == 500) {
|
||||||
@ -106,7 +111,7 @@ class Mount with ChangeNotifier {
|
|||||||
|
|
||||||
Future<void> setValue(String key, String value) async {
|
Future<void> setValue(String key, String value) async {
|
||||||
try {
|
try {
|
||||||
await http.put(
|
final response = await http.put(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
Uri.encodeFull(
|
Uri.encodeFull(
|
||||||
'${getBaseUri()}/api/v1/set_value_by_name?name=$name&type=$type&key=$key&value=$value',
|
'${getBaseUri()}/api/v1/set_value_by_name?name=$name&type=$type&key=$key&value=$value',
|
||||||
@ -114,6 +119,15 @@ class Mount with ChangeNotifier {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (response.statusCode == 404) {
|
||||||
|
_mountList?.reset();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response.statusCode != 200) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
return refresh();
|
return refresh();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrint('$e');
|
debugPrint('$e');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user