fix agent generation pending state on failures
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-03-25 23:31:10 +08:00
parent 54a4e15cf2
commit 80d862258b

View File

@ -2172,24 +2172,23 @@ export function AgentGenerationWorkspaceDarkV2({
return;
}
if (
pendingGeneration.modeType === "scene_generation" ||
pendingGeneration.modeType === "detail_generation"
) {
return;
}
if (!hasAssistantFailureAfterLastUser) {
return;
}
const hasProgress = latestReplacementResults.length > 0;
const hasProgress =
pendingGeneration.modeType === "scene_generation"
? currentSceneGeneratedUrls.length > 0
: pendingGeneration.modeType === "detail_generation"
? detailGenerationRunResults.length > 0
: latestReplacementResults.length > 0;
if (!hasProgress) {
setPendingGeneration(null);
}
}, [
currentSceneGeneratedUrls.length,
detailGenerationRunResults.length,
hasAssistantFailureAfterLastUser,
latestReplacementResults.length,
pendingGeneration,