fix(stream): while updating conv id

This commit is contained in:
ManishMadan2882
2024-10-05 02:46:32 +05:30
parent 5b01664d53
commit 67dddcb224
2 changed files with 2 additions and 4 deletions

View File

@@ -54,10 +54,6 @@ export default function Conversation() {
}
}, []);
useEffect(() => {
fetchStream.current && fetchStream.current.abort();
}, [conversationId]);
useEffect(() => {
if (queries.length) {
queries[queries.length - 1].error && setLastQueryReturnedErr(true);

View File

@@ -151,6 +151,7 @@ export const conversationSlice = createSlice({
state,
action: PayloadAction<{ index: number; query: Partial<Query> }>,
) {
if (state.status === 'idle') return;
const { index, query } = action.payload;
if (query.response != undefined) {
state.queries[index].response =
@@ -167,6 +168,7 @@ export const conversationSlice = createSlice({
action: PayloadAction<{ query: Partial<Query> }>,
) {
state.conversationId = action.payload.query.conversationId ?? null;
state.status = 'idle';
},
updateStreamingSource(
state,