mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 04:51:13 -05:00
Fix: Prevent bypass of blocking validation errors
This commit is contained in:
@@ -118,9 +118,10 @@ export function SubmissionReviewManager({
|
|||||||
} else {
|
} else {
|
||||||
next.add(itemId);
|
next.add(itemId);
|
||||||
}
|
}
|
||||||
// Clear blocking errors when selection changes
|
// Clear blocking errors and warning confirmation when selection changes
|
||||||
setHasBlockingErrors(false);
|
setHasBlockingErrors(false);
|
||||||
setValidationResults(new Map());
|
setValidationResults(new Map());
|
||||||
|
setUserConfirmedWarnings(false);
|
||||||
return next;
|
return next;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -179,7 +180,8 @@ export function SubmissionReviewManager({
|
|||||||
return result && result.blockingErrors.length > 0;
|
return result && result.blockingErrors.length > 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (itemsWithBlockingErrors.length > 0 && !userConfirmedWarnings) {
|
// CRITICAL: Blocking errors can NEVER be bypassed, regardless of warnings
|
||||||
|
if (itemsWithBlockingErrors.length > 0) {
|
||||||
setHasBlockingErrors(true);
|
setHasBlockingErrors(true);
|
||||||
setShowValidationBlockerDialog(true);
|
setShowValidationBlockerDialog(true);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
@@ -228,6 +230,9 @@ export function SubmissionReviewManager({
|
|||||||
variant: failCount > 0 ? 'destructive' : 'default',
|
variant: failCount > 0 ? 'destructive' : 'default',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Reset warning confirmation state after approval
|
||||||
|
setUserConfirmedWarnings(false);
|
||||||
|
|
||||||
onComplete();
|
onComplete();
|
||||||
onOpenChange(false);
|
onOpenChange(false);
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
|
|||||||
Reference in New Issue
Block a user