Merge branch 'master' into develop

isekai-main
Barış Soner Uşaklı 1 year ago
commit 29f77a8829

@ -18,7 +18,7 @@ define('admin/settings/general', ['admin/settings'], function () {
$('input[data-field="brand:maskableIcon"]').val('');
});
$('button[data-action="removeOgImage"]').on('click', function () {
$('input[data-field="removeOgImage"]').val('');
$('input[data-field="og:image"]').val('');
});
$('[data-field="homePageRoute"]').on('change', toggleCustomRoute);

@ -69,18 +69,23 @@ async function xhr(options, cb) {
const isJSON = contentType && contentType.startsWith('application/json');
let response;
if (isJSON) {
response = await res.json();
} else {
response = await res.text();
if (options.method !== 'head') {
if (isJSON) {
response = await res.json();
} else {
response = await res.text();
}
}
if (!res.ok) {
return cb(new Error(isJSON ? response.status.message : response));
if (response) {
return cb(new Error(isJSON ? response.status.message : response));
}
return cb(new Error(res.statusText));
}
cb(null, (
isJSON && response.hasOwnProperty('status') && response.hasOwnProperty('response') ?
isJSON && response && response.hasOwnProperty('status') && response.hasOwnProperty('response') ?
response.response :
response
));

Loading…
Cancel
Save