33
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-12-22 02:49:01 +00:00

Fixed setting progress header in case of error

Signed-off-by: Roland Dalmulder <contact@rolandd.com>
This commit is contained in:
Roland Dalmulder 2023-10-10 17:30:24 +07:00
parent 3c132ba2e8
commit 9f1593d1c2
No known key found for this signature in database
GPG Key ID: 6D30CD38749A5B9E

View File

@ -82,7 +82,7 @@ class PatchFetcher {
} catch (error) { } catch (error) {
try { try {
if (response.error || response.success === false) { 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); document.getElementById('patchtester-progress-message').innerHTML = Joomla.sanitizeHtml(response.message);
} }
} catch (ignore) { } catch (ignore) {
@ -90,7 +90,7 @@ class PatchFetcher {
error = Joomla.JText._('COM_PATCHTESTER_NO_ERROR_RETURNED'); 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('patchtester-progress-message').innerHTML = Joomla.sanitizeHtml(error);
document.getElementById('progress').remove(); document.getElementById('progress').remove();
} }
@ -99,7 +99,7 @@ class PatchFetcher {
}, },
onError: (jqXHR) => { onError: (jqXHR) => {
const json = (typeof jqXHR === 'object' && jqXHR.responseText) ? jqXHR.responseText : null; 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('patchtester-progress-message').innerHTML = Joomla.sanitizeHtml(json);
document.getElementById('progress').remove(); document.getElementById('progress').remove();
} }