Skip to content

Commit

Permalink
🐛 fix: fix the default agent not work correctly on new device (lobehu…
Browse files Browse the repository at this point in the history
…b#2699)

* 🐛 fix: fix

* 🐛 fix: fix session refresh issue
  • Loading branch information
arvinxx authored May 28, 2024
1 parent 3493129 commit e4c7536
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/store/agent/slices/chat/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/store/session/slices/session/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,6 @@ export const createSessionSlice: StateCreator<
);
},
refreshSessions: async () => {
await mutate(FETCH_SESSIONS_KEY);
await mutate([FETCH_SESSIONS_KEY, true]);
},
});

0 comments on commit e4c7536

Please sign in to comment.