fix(frontend): reconnect stream on same-session resume

This commit is contained in:
User
2026-07-14 20:53:19 +02:00
parent b1d1284cc8
commit 1393c6358e
5 changed files with 90 additions and 47 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ import { joinBackendPath } from "../api/runtime-config";
import { useSessionStore } from "../store/sessionStore";
import type { StreamEvent } from "../api/types";
export function useSessionStream(sessionId: string | null) {
export function useSessionStream(sessionId: string | null, generation = 0) {
const [connected, setConnected] = useState(false);
const applyEvent = useSessionStore((s) => s.applyEvent);
@@ -40,7 +40,7 @@ export function useSessionStream(sessionId: string | null) {
es.close();
setConnected(false);
};
}, [sessionId, applyEvent]);
}, [sessionId, generation, applyEvent]);
return { connected };
}