Immediately check for new configuration after we check for updates

This commit is contained in:
Johannes Zellner
2018-03-30 15:29:45 +02:00
parent 8d6de76fa0
commit 8ebcc2f8af

View File

@@ -455,15 +455,9 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
Client.prototype.checkForUpdates = function (callback) {
var that = this;
if (that._refreshConfigTimer) $interval.cancel(that._refreshConfigTimer);
that._refreshConfigTimer = null;
post('/api/v1/cloudron/check_for_updates', { }).success(function(data, status) {
post('/api/v1/cloudron/check_for_updates', {}).success(function(data, status) {
if (status !== 200) return callback(new ClientError(status, data));
that._refreshConfigTimer = $interval(that.refreshConfig.bind(that), 5000, 20 /* 20 times */);
callback(null);
that.refreshConfig(callback);
}).error(defaultErrorHandler(callback));
};