mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 06:11:12 -05:00
feat: Implement emergency hotfixes
This commit is contained in:
@@ -222,17 +222,26 @@ export function SubmissionReviewManager({
|
||||
const successCount = data.results.filter((r: any) => r.success).length;
|
||||
const failCount = data.results.filter((r: any) => !r.success).length;
|
||||
|
||||
const allFailed = failCount > 0 && successCount === 0;
|
||||
const someFailed = failCount > 0 && successCount > 0;
|
||||
|
||||
toast({
|
||||
title: 'Approval Complete',
|
||||
title: allFailed ? 'Approval Failed' : someFailed ? 'Partial Approval' : 'Approval Complete',
|
||||
description: failCount > 0
|
||||
? `Approved ${successCount} item(s), ${failCount} failed`
|
||||
: `Successfully approved ${successCount} item(s)`,
|
||||
variant: failCount > 0 ? 'destructive' : 'default',
|
||||
variant: allFailed ? 'destructive' : someFailed ? 'default' : 'default',
|
||||
});
|
||||
|
||||
// Reset warning confirmation state after approval
|
||||
setUserConfirmedWarnings(false);
|
||||
|
||||
// If ALL items failed, don't close dialog - show errors
|
||||
if (allFailed) {
|
||||
setLoading(false);
|
||||
return;
|
||||
}
|
||||
|
||||
onComplete();
|
||||
onOpenChange(false);
|
||||
} catch (error: any) {
|
||||
|
||||
Reference in New Issue
Block a user