fix: stops stream upon conversation

This commit is contained in:
Daniel Avila 2023-03-11 21:42:08 -05:00
parent 79f050bac7
commit 23de688bf3
6 changed files with 218 additions and 120 deletions

View file

@ -2,12 +2,13 @@ import { createSlice } from '@reduxjs/toolkit';
const initialState = {
isSubmitting: false,
submission: {},
stopStream: false,
disabled: false,
model: 'chatgpt',
promptPrefix: '',
chatGptLabel: '',
customModel: null
customModel: null,
};
const currentSlice = createSlice({
@ -17,6 +18,9 @@ const currentSlice = createSlice({
setSubmitState: (state, action) => {
state.isSubmitting = action.payload;
},
setSubmission: (state, action) => {
state.submission = action.payload;
},
setStopStream: (state, action) => {
state.stopStream = action.payload;
},
@ -36,7 +40,7 @@ const currentSlice = createSlice({
}
});
export const { setSubmitState, setStopStream, setDisabled, setModel, setCustomGpt, setCustomModel } =
export const { setSubmitState, setSubmission, setStopStream, setDisabled, setModel, setCustomGpt, setCustomModel } =
currentSlice.actions;
export default currentSlice.reducer;