purge logs and !need code

This commit is contained in:
ManishMadan2882
2024-02-07 05:04:16 +05:30
parent 3c68cbc955
commit 0ce39e7f52
2 changed files with 13 additions and 15 deletions

View File

@@ -18,8 +18,6 @@ export const fetchAnswer = createAsyncThunk<Answer, { question: string }>(
'fetchAnswer',
async ({ question }, { dispatch, getState, signal }) => {
const state = getState() as RootState;
console.log('signal', signal);
if (state.preference) {
if (API_STREAMING) {
await fetchAnswerSteaming(
@@ -198,7 +196,11 @@ export const conversationSlice = createSlice({
state.status = 'loading';
})
.addCase(fetchAnswer.rejected, (state, action) => {
if(action.meta.aborted)return state; //ignore error
if(action.meta.aborted)
{
state.status = 'idle';
return state;
}
state.status = 'failed';
state.queries[state.queries.length - 1].error =
'Something went wrong. Please try again later.';