fix(fork): clear task selection before navigating to fork (#4356)

This commit is contained in:
Waleed
2026-04-29 23:39:02 -07:00
committed by GitHub
parent cb43b596b9
commit cb8ea3a870
@@ -21,6 +21,7 @@ import {
import { cn } from '@/lib/core/utils/cn'
import { useSubmitCopilotFeedback } from '@/hooks/queries/copilot-feedback'
import { useForkTask } from '@/hooks/queries/tasks'
import { useFolderStore } from '@/stores/folders/store'
const SPECIAL_TAGS = 'thinking|options|usage_upgrade|credential|mothership-error|file'
@@ -154,6 +155,7 @@ export const MessageActions = memo(function MessageActions({
if (!chatId || !messageId || forkTask.isPending) return
try {
const result = await forkTask.mutateAsync({ chatId, upToMessageId: messageId })
useFolderStore.getState().clearTaskSelection()
router.push(`/workspace/${params.workspaceId}/task/${result.id}`)
} catch {
toast.error('Failed to fork chat')