diff --git a/src/features/MarketInfo/index.tsx b/src/features/MarketInfo/index.tsx index 611fbcec..25d9cf6b 100644 --- a/src/features/MarketInfo/index.tsx +++ b/src/features/MarketInfo/index.tsx @@ -9,6 +9,7 @@ import AgentCard from '@/components/agent/AgentCard'; import SystemRole from '@/components/agent/SystemRole'; import { SIDEBAR_MAX_WIDTH, SIDEBAR_WIDTH } from '@/constants/common'; import { agentListSelectors, useAgentStore } from '@/store/agent'; +import { useConfigStore } from '@/store/config'; import { marketStoreSelectors, useMarketStore } from '@/store/market'; import { useSessionStore } from '@/store/session'; @@ -36,6 +37,7 @@ const Header = () => { marketStoreSelectors.currentAgentItem(s), ], ); + const [closePanel] = useConfigStore((s) => [s.closePanel]); const [subscribe, unsubscribe, subscribed] = useAgentStore((s) => [ s.subscribe, s.unsubscribe, @@ -55,6 +57,7 @@ const Header = () => { onClick={() => { createSession(currentAgentItem); router.push('/chat'); + closePanel('market'); }} type={'primary'} > diff --git a/src/store/session/index.ts b/src/store/session/index.ts index 3bc1fc69..21575087 100644 --- a/src/store/session/index.ts +++ b/src/store/session/index.ts @@ -144,6 +144,10 @@ export const createSessonStore: StateCreator { const { sessionList } = get(); + if (agent.agentId === LOBE_VIDOL_DEFAULT_AGENT_ID) { + set({ activeId: agent.agentId }); + return; + } const newSessionList = produce(sessionList, (draft) => { const index = draft.findIndex((session) => session.agentId === agent.agentId);