From 89c36ae6a9d4853ed6b0413463544926aad365b5 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Wed, 29 Jul 2015 14:15:44 +0200 Subject: [PATCH] Do not show the update page if update failed --- webadmin/src/js/client.js | 2 +- webadmin/src/js/main.js | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/webadmin/src/js/client.js b/webadmin/src/js/client.js index d602f8474..bdbf3ba11 100644 --- a/webadmin/src/js/client.js +++ b/webadmin/src/js/client.js @@ -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); diff --git a/webadmin/src/js/main.js b/webadmin/src/js/main.js index 7fcd36a48..6ad7bf783 100644 --- a/webadmin/src/js/main.js +++ b/webadmin/src/js/main.js @@ -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'; }