Skip to content
Snippets Groups Projects
Commit 10ea3f61 authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #17436 from owncloud/update-keeppageifwarnings

Keep update page when there are warnings
parents 76b399d9 993e7eee
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
return; return;
} }
var hasWarnings = false;
this.$el = $el; this.$el = $el;
this._started = true; this._started = true;
...@@ -40,6 +42,7 @@ ...@@ -40,6 +42,7 @@
}); });
updateEventSource.listen('notice', function(message) { updateEventSource.listen('notice', function(message) {
$('<span>').addClass('error').append(message).append('<br />').appendTo($el); $('<span>').addClass('error').append(message).append('<br />').appendTo($el);
hasWarnings = true;
}); });
updateEventSource.listen('error', function(message) { updateEventSource.listen('error', function(message) {
$('<span>').addClass('error').append(message).append('<br />').appendTo($el); $('<span>').addClass('error').append(message).append('<br />').appendTo($el);
...@@ -57,14 +60,23 @@ ...@@ -57,14 +60,23 @@
.appendTo($el); .appendTo($el);
}); });
updateEventSource.listen('done', function() { updateEventSource.listen('done', function() {
// FIXME: use product name if (hasWarnings) {
$('<span>').addClass('bold') $('<span>').addClass('bold')
.append('<br />') .append('<br />')
.append(t('core', 'The update was successful. Redirecting you to ownCloud now.')) .append(t('core', 'The update was successful. There were warnings.'))
.appendTo($el); .appendTo($el);
setTimeout(function () { var message = t('core', 'Please reload the page.');
OC.redirect(OC.webroot); $('<span>').append('<br />').append(message).append('<br />').appendTo($el);
}, 3000); } 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);
}
}); });
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment