Skip to content

Commit 07ee8e5

Browse files
Keep recent copilot chat open on refresh
1 parent 81f221b commit 07ee8e5

1 file changed

Lines changed: 2 additions & 4 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: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,9 @@ export const Panel = memo(function Panel({ workspaceId: propWorkspaceId }: Panel
265265

266266
if (copilotChatId) return
267267
if (autoSelectAttemptedForRef.current.has(activeWorkflowId)) return
268+
if (copilotChatList.length === 0) return
268269
autoSelectAttemptedForRef.current.add(activeWorkflowId)
269-
270-
if (copilotChatList.length > 0) {
271-
setCopilotChatId(copilotChatList[0].id)
272-
}
270+
setCopilotChatId(copilotChatList[0].id)
273271
}, [copilotChatList, copilotChatId, activeWorkflowId, setCopilotChatId])
274272

275273
useEffect(() => {

0 commit comments

Comments
 (0)