mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-19 14:41:24 +08:00
fix: move newly created agent session to top (#10711)
This commit is contained in:
parent
7cf57adceb
commit
004d6d8201
@ -21,7 +21,7 @@ export const useSessions = (agentId: string) => {
|
||||
async (form: CreateSessionForm) => {
|
||||
try {
|
||||
const result = await client.createSession(agentId, form)
|
||||
await mutate((prev) => [...(prev ?? []), result], { revalidate: false })
|
||||
await mutate((prev) => [result, ...(prev ?? [])], { revalidate: false })
|
||||
return result
|
||||
} catch (error) {
|
||||
window.toast.error(formatErrorMessageWithPrefix(error, t('agent.session.create.error.failed')))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user