mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
fix(fork): clear task selection before navigating to fork (#4356)
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user