fixed injection watcher

This commit is contained in:
2026-06-11 08:18:30 +03:00
parent 481b93e84a
commit b5a1831b8e
5 changed files with 56 additions and 18 deletions
+5 -3
View File
@@ -190,7 +190,6 @@ export default function Chat() {
setStreaming("");
setLiveNotices([]);
setChatError(null);
setLoading(false);
if (assistantText.trim()) {
setMessages((prev) => [
...prev,
@@ -202,8 +201,8 @@ export default function Chat() {
},
]);
}
void loadMessages(activeId);
void loadSessions();
await loadMessages(activeId);
await loadSessions();
}
if (chunk.event === "error") {
throw new Error(chunk.data.message);
@@ -214,6 +213,9 @@ export default function Chat() {
const message = err instanceof Error ? err.message : "Ошибка чата";
setChatError(message);
setStreaming("");
if (activeId) {
await loadMessages(activeId);
}
} finally {
setLoading(false);
}