From 7f3a5de20cacf86b42d80846cc1407c8b8fdfe8b Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 22 Mar 2021 16:31:50 +0100 Subject: [PATCH] Use the product name in the updater screen Signed-off-by: Joas Schilling --- core/js/update.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/core/js/update.js b/core/js/update.js index c5f8b09d68..5c1054adcb 100644 --- a/core/js/update.js +++ b/core/js/update.js @@ -11,6 +11,7 @@ (function() { OC.Update = { _started : false, + options: {}, /** * Start the update process. @@ -22,6 +23,7 @@ return; } + this.options = options; var hasWarnings = false; this.$el = $el; @@ -72,7 +74,7 @@ var updateUnsuccessful = $('

'); if(message === 'Exception: Updates between multiple major versions and downgrades are unsupported.') { updateUnsuccessful.append(t('core', 'The update was unsuccessful. For more information check our forum post covering this issue.', {'url': 'https://help.nextcloud.com/t/updates-between-multiple-major-versions-are-unsupported/7094'})); - } else { + } else if (OC.Update.options.productName === 'Nextcloud') { updateUnsuccessful.append(t('core', 'The update was unsuccessful. ' + 'Please report this issue to the ' + 'Nextcloud community.')); @@ -86,18 +88,15 @@ $('#update-progress-icon') .addClass('icon-checkmark-white') - .removeClass('icon-loading-dark'); + .removeClass('icon-loading-dark'); if (hasWarnings) { $el.find('.update-show-detailed').before( - $('').on('click', function() { + $('').on('click', function() { window.location.reload(); }) ); } else { - // FIXME: use product name - - $el.find('.update-show-detailed').before( $('

') ); @@ -115,7 +114,9 @@ updateCountdown: function (i, total) { setTimeout(function(){ - $("#redirect-countdown").text(n('core', 'The update was successful. Redirecting you to Nextcloud in %n second.', 'The update was successful. Redirecting you to Nextcloud in %n seconds.', i)); + $("#redirect-countdown").text( + n('core', 'The update was successful. Redirecting you to {productName} in %n second.', 'The update was successful. Redirecting you to {productName} in %n seconds.', i, OC.Update.options) + ); }, (total - i) * 1000); },