mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
Merge pull request #1238 from ManishMadan2882/main
Bug Fix: Crash, abnormal update while switching conversation Ids
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user