Skip to content

Commit

Permalink
Fixed setting progress header in case of error
Browse files Browse the repository at this point in the history
Signed-off-by: Roland Dalmulder <contact@rolandd.com>
  • Loading branch information
roland-d committed Oct 10, 2023
1 parent 3c132ba commit 9f1593d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions media/com_patchtester/js/fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ class PatchFetcher {
} catch (error) {
try {
if (response.error || response.success === false) {
document.getElementById('patchtester-progress-header').innerText(Joomla.JText._('COM_PATCHTESTER_FETCH_AN_ERROR_HAS_OCCURRED'));
document.getElementById('patchtester-progress-header').innerText = Joomla.JText._('COM_PATCHTESTER_FETCH_AN_ERROR_HAS_OCCURRED');
document.getElementById('patchtester-progress-message').innerHTML = Joomla.sanitizeHtml(response.message);
}
} catch (ignore) {
if (error === '') {
error = Joomla.JText._('COM_PATCHTESTER_NO_ERROR_RETURNED');
}

document.getElementById('patchtester-progress-header').innerText(Joomla.JText._('COM_PATCHTESTER_FETCH_AN_ERROR_HAS_OCCURRED'));
document.getElementById('patchtester-progress-header').innerText = Joomla.JText._('COM_PATCHTESTER_FETCH_AN_ERROR_HAS_OCCURRED');
document.getElementById('patchtester-progress-message').innerHTML = Joomla.sanitizeHtml(error);
document.getElementById('progress').remove();
}
Expand All @@ -99,7 +99,7 @@ class PatchFetcher {
},
onError: (jqXHR) => {
const json = (typeof jqXHR === 'object' && jqXHR.responseText) ? jqXHR.responseText : null;
document.getElementById('patchtester-progress-header').innerText(Joomla.JText._('COM_PATCHTESTER_FETCH_AN_ERROR_HAS_OCCURRED'));
document.getElementById('patchtester-progress-header').innerText = Joomla.JText._('COM_PATCHTESTER_FETCH_AN_ERROR_HAS_OCCURRED');
document.getElementById('patchtester-progress-message').innerHTML = Joomla.sanitizeHtml(json);
document.getElementById('progress').remove();
}
Expand Down

0 comments on commit 9f1593d

Please sign in to comment.