This commit is contained in:
2026-08-10 18:38:14 +02:00
parent 2e53e7e173
commit e894795fe0
4 changed files with 22 additions and 14 deletions

View File

@@ -2820,18 +2820,10 @@ window.initUploadForm = (selector) => {
}
};
// Skip redirect if every item was a background URL job
// Inject item into grid without redirecting
const allPending = lastData?.pending && selectedFiles.every(i => i.type === 'url');
if (!allPending) {
const targetUrl = (lastData && (lastData.visibility > 0 || lastData.redirect || lastData.slug))
? (lastData.redirect || `/${lastData.slug || lastData.itemid}`)
: '/';
if (typeof window.loadPageAjax === 'function') {
await window.loadPageAjax(targetUrl, true, { bypassCache: true });
if (targetUrl === '/') injectNewItem();
} else {
window.location.href = targetUrl;
}
injectNewItem();
}
} else {
restoreBtn();