LibreChat/store/convoSlice.js

23 lines
451 B
JavaScript
Raw Normal View History

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