mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-07 16:42:38 +01:00
adding clear methods for convos
This commit is contained in:
parent
c7c50dbbab
commit
6e3f63ee46
16 changed files with 466 additions and 121 deletions
22
store/convoSlice.js
Normal file
22
store/convoSlice.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
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;
|
||||
11
store/index.js
Normal file
11
store/index.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { configureStore } from '@reduxjs/toolkit';
|
||||
|
||||
import convoReducer from './convoSlice.js';
|
||||
// import uploadReducer from './uploadSlice.js';
|
||||
|
||||
export const store = configureStore({
|
||||
reducer: {
|
||||
convo: convoReducer,
|
||||
// upload: uploadReducer,
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue