feat: loading state for messages

This commit is contained in:
Daniel Avila 2023-03-11 18:39:46 -05:00
parent afae13eec6
commit 79f050bac7
6 changed files with 43 additions and 8 deletions

View file

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