update: match the ui in settings page
This commit is contained in:
@@ -1287,21 +1287,27 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
busyUpdate: false,
|
||||
busyAutomaticUpdates: false,
|
||||
skipBackup: false,
|
||||
enableAutomaticUpdate: true,
|
||||
|
||||
show: function () {
|
||||
$scope.updates.skipBackup = false;
|
||||
$scope.updates.enableAutomaticUpdate = $scope.app.enableAutomaticUpdate;
|
||||
},
|
||||
|
||||
toggleAutomaticUpdates: function () {
|
||||
$scope.updates.busyAutomaticUpdates = true;
|
||||
|
||||
Client.configureApp($scope.app.id, 'automatic_update', { enable: !$scope.app.enableAutomaticUpdate }, function (error) {
|
||||
Client.configureApp($scope.app.id, 'automatic_update', { enable: !$scope.updates.enableAutomaticUpdate }, function (error) {
|
||||
if (error) return Client.error(error);
|
||||
|
||||
refreshApp($scope.app.id, function (error) {
|
||||
if (error) console.error(error);
|
||||
|
||||
$scope.updates.busyAutomaticUpdates = false;
|
||||
$timeout(function () {
|
||||
console.log($scope.updates.enableAutomaticUpdate, $scope.app.enableAutomaticUpdate);
|
||||
$scope.updates.enableAutomaticUpdate = $scope.app.enableAutomaticUpdate;
|
||||
$scope.updates.busyAutomaticUpdates = false;
|
||||
}, 2000);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user