Do not show the update page if update failed

This commit is contained in:
Johannes Zellner
2015-07-29 14:15:44 +02:00
parent 3027c119fe
commit 89c36ae6a9
2 changed files with 3 additions and 5 deletions

View File

@@ -32,7 +32,7 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification',
return callback(new ClientError(status, data));
}
if (result.update) window.location.href = '/update.html';
if (result.update && result.update.percent !== -1) window.location.href = '/update.html';
else callback(new ClientError(status, data));
}, function (data, status) {
client.error(data);

View File

@@ -86,9 +86,6 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
if (error && error.statusCode === 401) return $scope.login();
if (error) return $scope.error(error);
// check if we are actually updating
if (Client.getConfig().progress.update && Client.getConfig().progress.update.percent < 100) window.location.href = '/update.html';
Client.refreshUserInfo(function (error, result) {
if (error) return $scope.error(error);
@@ -122,7 +119,8 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
// wait till the view has loaded until showing a modal dialog
Client.onConfig(function (config) {
if (config.progress.update && config.progress.update.percent < 100) {
// check if we are actually updating
if (config.progress.update && config.progress.update.percent !== -1) {
window.location.href = '/update.html';
}