alroyso 1 year ago
parent
commit
c15fe8eeb6
2 changed files with 6 additions and 3 deletions
  1. 4 1
      lib/app/controller/core.dart
  2. 2 2
      lib/app/controller/tray.dart

+ 4 - 1
lib/app/controller/core.dart

@@ -90,7 +90,10 @@ class CoreController extends GetxController {
   Future<void> changeConfig(String configPath) async{
     for (var i = 0 ; i< 5; i++) {
       try {
-        await dio.put('/configs', data: {"path": configPath});
+       final data =  await dio.put('/configs', data: {"path": configPath});
+       if(data.statusCode != 204){
+         continue;
+       }
       }
       catch (e) {
        continue;

+ 2 - 2
lib/app/controller/tray.dart

@@ -121,10 +121,10 @@ class TrayController extends GetxController with TrayListener {
   Future<void> handleClickConsoleShow(MenuItem menuItem) async {
     isSHow = true;
     if (menuItem.checked == true) {
-      isShowConsole.value = true;
+      isShowConsole.value = false;
       controllers.global.hideConsole();
     } else {
-      isShowConsole.value = false;
+      isShowConsole.value = true;
       controllers.global.showConsole();
     }
   }