fixed injection watcher
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user