From 618dfbb71ee1c1548c2a4cf97c28e83bda3d788b Mon Sep 17 00:00:00 2001 From: rdmclin2 Date: Mon, 13 May 2024 23:32:54 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20fix:=20=E4=BF=AE=E5=A4=8D=E5=AE=98?= =?UTF-8?q?=E6=96=B9=E5=8A=A9=E6=89=8B=E8=81=8A=E5=A4=A9=E4=BA=A7=E7=94=9F?= =?UTF-8?q?=E6=96=B0=E7=9A=84=20session?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/MarketInfo/index.tsx | 3 +++ src/store/session/index.ts | 4 ++++ 2 files changed, 7 insertions(+) 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);