jQuery(function ($) {

let refreshDone = false;

const observer =
new MutationObserver(
function () {

if (
refreshDone
) {
return;
}

if (
$('.upload-success')
.length
) {

refreshDone =
true;

observer.disconnect();

window.setTimeout(
function () {

window.location.reload();

},
1500
);

}

}
);

observer.observe(
document.body,
{
childList: true,
subtree: true
}
);

});