From e4c7536b8c7c524818f730890d3af70892b5cbf1 Mon Sep 17 00:00:00 2001 From: Arvin Xu Date: Tue, 28 May 2024 19:53:42 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20fix=20the=20default=20age?= =?UTF-8?q?nt=20not=20work=20correctly=20on=20new=20device=20(#2699)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🐛 fix: fix * 🐛 fix: fix session refresh issue --- src/store/agent/slices/chat/action.ts | 18 +++++++++--------- src/store/session/slices/session/action.ts | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/store/agent/slices/chat/action.ts b/src/store/agent/slices/chat/action.ts index 0c78b65af9fe..0c8c5e7a0522 100644 --- a/src/store/agent/slices/chat/action.ts +++ b/src/store/agent/slices/chat/action.ts @@ -117,16 +117,16 @@ export const createChatSlice: StateCreator< () => sessionService.getSessionConfig(INBOX_SESSION_ID), { onSuccess: (data) => { - if (data) { - set( - { - defaultAgentConfig: merge(get().defaultAgentConfig, defaultAgentConfig), - isInboxAgentConfigInit: true, - }, - false, - 'initStore', - ); + set( + { + defaultAgentConfig: merge(get().defaultAgentConfig, defaultAgentConfig), + isInboxAgentConfigInit: true, + }, + false, + 'initDefaultAgent', + ); + if (data) { get().internal_dispatchAgentMap(INBOX_SESSION_ID, data, 'initInbox'); } }, diff --git a/src/store/session/slices/session/action.ts b/src/store/session/slices/session/action.ts index 83e6c0937ad5..e96e75950473 100644 --- a/src/store/session/slices/session/action.ts +++ b/src/store/session/slices/session/action.ts @@ -265,6 +265,6 @@ export const createSessionSlice: StateCreator< ); }, refreshSessions: async () => { - await mutate(FETCH_SESSIONS_KEY); + await mutate([FETCH_SESSIONS_KEY, true]); }, });