Immediately show the auto update state when directly visiting the app update section

This commit is contained in:
Johannes Zellner
2022-10-06 16:17:25 +02:00
parent e4c507d9b6
commit a285ebc749
2 changed files with 8 additions and 12 deletions

View File

@@ -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);
});
});
},