Skip to content

Commit 8329f1c

Browse files
author
Theodore Li
committed
Fix "fix in copilot" button
1 parent ace8779 commit 8329f1c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,17 @@ export const Panel = memo(function Panel({ workspaceId: propWorkspaceId }: Panel
410410
setHasHydrated(true)
411411
}, [setHasHydrated])
412412

413+
useEffect(() => {
414+
const handler = (e: Event) => {
415+
const message = (e as CustomEvent<{ message: string }>).detail?.message
416+
if (!message) return
417+
setActiveTab('copilot')
418+
setCopilotEditingInputValue(message)
419+
}
420+
window.addEventListener('mothership-send-message', handler)
421+
return () => window.removeEventListener('mothership-send-message', handler)
422+
}, [setActiveTab])
423+
413424
/**
414425
* Handles tab click events
415426
*/

0 commit comments

Comments
 (0)