adding clear methods for convos

This commit is contained in:
Daniel Avila 2023-02-06 21:17:46 -05:00
parent c7c50dbbab
commit 6e3f63ee46
16 changed files with 466 additions and 121 deletions

22
store/convoSlice.js Normal file
View 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
View 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,
},
});