Browse Source

Update config (#5444)

* gui: Update config from remote after saving (fixes #5354)

* Refresh is async :(
Audrius Butkevicius 6 years ago
parent
commit
801e9b57eb
1 changed files with 8 additions and 7 deletions
  1. 8 7
      gui/default/syncthing/core/syncthingController.js

+ 8 - 7
gui/default/syncthing/core/syncthingController.js

@@ -1211,13 +1211,14 @@ angular.module('syncthing.core')
                 }
             };
             $http.post(urlbase + '/system/config', cfg, opts).success(function () {
-                $http.get(urlbase + '/system/config/insync').success(function (data) {
-                    $scope.configInSync = data.configInSync;
-                    if (cb) {
-                        cb();
-                    }
-                });
-            }).error($scope.emitHTTPError);
+                refreshConfig();
+                if (cb) {
+                    cb();
+                }
+            }).error(function (data, status, headers, config) {
+                refreshConfig();
+                $scope.emitHTTPError(data, status, headers, config);
+            });
         };
 
         $scope.urVersions = function () {