LibreChat/src/store/convoSlice.js

27 lines
539 B
JavaScript
Raw Normal View History

2023-02-06 21:17:46 -05:00
import { createSlice } from '@reduxjs/toolkit';
const initialState = {
error: false,
title: 'ChatGPT Clone',
2023-02-06 21:17:46 -05:00
conversationId: null,
parentMessageId: null,
};
const currentSlice = createSlice({
name: 'convo',
initialState,
reducers: {
setConversation: (state, action) => {
return { ...state, ...action.payload };
2023-02-06 21:17:46 -05:00
},
setError: (state, action) => {
state.error = action.payload;
},
2023-02-06 21:17:46 -05:00
}
});
//
2023-02-06 21:17:46 -05:00
export const { setConversation, setError } = currentSlice.actions;
2023-02-06 21:17:46 -05:00
export default currentSlice.reducer;