summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-07-07 13:38:24 +0200
committerVincent Petry <pvince81@owncloud.com>2015-07-07 13:38:24 +0200
commit993e7eeec7128fcf0c4ae1778e58ac4ea5703956 (patch)
treeb80c0f14fba735e2017577a4adbb049f1d2bce4a /core
parent645600ae03101c1212576022548781641f2b4970 (diff)
downloadnextcloud-server-993e7eeec7128fcf0c4ae1778e58ac4ea5703956.tar.gz
nextcloud-server-993e7eeec7128fcf0c4ae1778e58ac4ea5703956.zip
Keep update page when there are warnings
Whenever there were warnings during an update, the page will not be redirected any more.
Diffstat (limited to 'core')
-rw-r--r--core/js/update.js28
1 files changed, 20 insertions, 8 deletions
diff --git a/core/js/update.js b/core/js/update.js
index 60f04832935..fd3c7a56bd6 100644
--- a/core/js/update.js
+++ b/core/js/update.js
@@ -22,6 +22,8 @@
return;
}
+ var hasWarnings = false;
+
this.$el = $el;
this._started = true;
@@ -40,6 +42,7 @@
});
updateEventSource.listen('notice', function(message) {
$('<span>').addClass('error').append(message).append('<br />').appendTo($el);
+ hasWarnings = true;
});
updateEventSource.listen('error', function(message) {
$('<span>').addClass('error').append(message).append('<br />').appendTo($el);
@@ -57,14 +60,23 @@
.appendTo($el);
});
updateEventSource.listen('done', function() {
- // FIXME: use product name
- $('<span>').addClass('bold')
- .append('<br />')
- .append(t('core', 'The update was successful. Redirecting you to ownCloud now.'))
- .appendTo($el);
- setTimeout(function () {
- OC.redirect(OC.webroot);
- }, 3000);
+ if (hasWarnings) {
+ $('<span>').addClass('bold')
+ .append('<br />')
+ .append(t('core', 'The update was successful. There were warnings.'))
+ .appendTo($el);
+ var message = t('core', 'Please reload the page.');
+ $('<span>').append('<br />').append(message).append('<br />').appendTo($el);
+ } else {
+ // FIXME: use product name
+ $('<span>').addClass('bold')
+ .append('<br />')
+ .append(t('core', 'The update was successful. Redirecting you to ownCloud now.'))
+ .appendTo($el);
+ setTimeout(function () {
+ OC.redirect(OC.webroot);
+ }, 3000);
+ }
});
},