Fix tab not switching to Review after discussion guide generation
The useEffect that reverts to Setup tab on cancellation was incorrectly firing after successful generation. Added check for discussionGuide to only revert when generation was actually cancelled (no guide exists). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
ea6a78bbb4
commit
0f72c54dfb
1 changed files with 5 additions and 5 deletions
|
|
@ -1023,14 +1023,14 @@ export default function FocusGroupModerator({ draftToEdit, onDraftSaved, preSele
|
|||
guideGenerationControls.resetGeneration();
|
||||
};
|
||||
|
||||
// Switch to Setup tab when discussion guide generation is cancelled
|
||||
// Switch to Setup tab when discussion guide generation is cancelled (not completed successfully)
|
||||
useEffect(() => {
|
||||
if (!guideGenerationState.isGenerating && !guideGenerationState.isCancelling &&
|
||||
guideGenerationState.taskId === null && activeTab === 'review') {
|
||||
// This indicates cancellation completed - switch back to setup
|
||||
if (!guideGenerationState.isGenerating && !guideGenerationState.isCancelling &&
|
||||
guideGenerationState.taskId === null && activeTab === 'review' && !discussionGuide) {
|
||||
// Only revert to setup if no guide was generated (i.e., cancellation, not success)
|
||||
setActiveTab('setup');
|
||||
}
|
||||
}, [guideGenerationState.isGenerating, guideGenerationState.isCancelling, guideGenerationState.taskId, activeTab]);
|
||||
}, [guideGenerationState.isGenerating, guideGenerationState.isCancelling, guideGenerationState.taskId, activeTab, discussionGuide]);
|
||||
|
||||
async function onSubmit(values: z.infer<typeof formSchema>) {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue