diff --git a/src/admin/components/odin/OdinChat.tsx b/src/admin/components/odin/OdinChat.tsx index cdf85f1..5e71e0c 100644 --- a/src/admin/components/odin/OdinChat.tsx +++ b/src/admin/components/odin/OdinChat.tsx @@ -153,6 +153,9 @@ export default function OdinChat() { }) .then((r) => { if (!r.ok) return r.json().then((b) => Promise.reject(b?.error)); + // The append applies the server-side auto-title and bumps updated_at, + // so refresh the list now (a new conversation gets its real title here). + qc.invalidateQueries({ queryKey: ["ai", "conversations"] }); }) .catch((e) => console.error("[odin] history persist failed", e)); }; @@ -191,7 +194,8 @@ export default function OdinChat() { const id = b.data.conversation.id as number; seededId.current = id; setActiveId(id); - qc.invalidateQueries({ queryKey: ["ai", "conversations"] }); + // Don't refresh the list yet — the conversation is still the default + // "Nová konverzace" here; persist() invalidates after the auto-title lands. return id; };