Immediately show the auto update state when directly visiting the app update section
This commit is contained in:
@@ -1081,25 +1081,21 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
busyAutomaticUpdates: false,
|
||||
skipBackup: false,
|
||||
|
||||
enableAutomaticUpdate: false,
|
||||
|
||||
show: function () {
|
||||
var app = $scope.app;
|
||||
|
||||
$scope.updates.enableAutomaticUpdate = app.enableAutomaticUpdate;
|
||||
$scope.updates.skipBackup = false;
|
||||
},
|
||||
|
||||
toggleAutomaticUpdates: function () {
|
||||
$scope.updates.busyAutomaticUpdates = true;
|
||||
|
||||
Client.configureApp($scope.app.id, 'automatic_update', { enable: !$scope.updates.enableAutomaticUpdate }, function (error) {
|
||||
Client.configureApp($scope.app.id, 'automatic_update', { enable: !$scope.app.enableAutomaticUpdate }, function (error) {
|
||||
if (error) return Client.error(error);
|
||||
|
||||
$timeout(function () {
|
||||
$scope.updates.enableAutomaticUpdate = !$scope.updates.enableAutomaticUpdate;
|
||||
refreshApp($scope.app.id, function (error) {
|
||||
if (error) console.error(error);
|
||||
|
||||
$scope.updates.busyAutomaticUpdates = false;
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user