diff --git a/src/js/client.js b/src/js/client.js index 4e2929e43..a1372ec11 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -991,6 +991,15 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout }); }; + Client.prototype.checkForAppUpdates = function (appId, callback) { + post('/api/v1/apps/' + appId + '/check_for_updates', {}, null, function (error, data, status) { + if (error) return callback(error); + if (status !== 200) return callback(new ClientError(status, data)); + + client.refreshConfig(callback); + }); + }; + Client.prototype.setAutoupdatePattern = function (pattern, callback) { post('/api/v1/settings/autoupdate_pattern', { pattern: pattern }, null, function (error, data, status) { if (error) return callback(error); diff --git a/src/views/app.js b/src/views/app.js index bdd51a4aa..1a28bdff5 100644 --- a/src/views/app.js +++ b/src/views/app.js @@ -932,7 +932,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location' check: function () { $scope.updates.busyCheck = true; - Client.checkForUpdates(function (error) { + Client.checkForAppUpdates($scope.app.id, function (error) { if (error) Client.error(error); $scope.updates.busyCheck = false;