fix: block empty import confirmations
Disable and guard host selection confirmation whenever the current preflight produces zero jobs, preserving pending files and plan state for empty destination and fully size-limited selections.
This commit is contained in:
+6
-2
@@ -1285,7 +1285,7 @@ function closeHosterModal() {
|
||||
}
|
||||
|
||||
async function applyHosterSelection() {
|
||||
if (_pendingImportInspections > 0) return false;
|
||||
if (isImportConfirmationBlocked()) return false;
|
||||
selectedUploadHosters = Array.from(document.querySelectorAll('input[data-hoster-modal]:checked'))
|
||||
.map(input => input.dataset.hosterModal);
|
||||
// Move pending files to selectedFiles on confirm
|
||||
@@ -1613,9 +1613,13 @@ function getImportPlanSummary() {
|
||||
});
|
||||
}
|
||||
|
||||
function isImportConfirmationBlocked() {
|
||||
return _pendingImportInspections > 0 || getImportPlanSummary()?.jobCount === 0;
|
||||
}
|
||||
|
||||
function syncImportConfirmationState() {
|
||||
const confirmButton = document.getElementById('confirmHosterModalBtn');
|
||||
if (confirmButton) confirmButton.disabled = _pendingImportInspections > 0;
|
||||
if (confirmButton) confirmButton.disabled = isImportConfirmationBlocked();
|
||||
}
|
||||
|
||||
function renderImportPlanSummary() {
|
||||
|
||||
Reference in New Issue
Block a user