Do not show the update page if update failed
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user