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) => {
|
2023-02-07 00:05:00 -05:00
|
|
|
const { conversationId, parentMessageId } = action.payload;
|
|
|
|
|
state.conversationId = conversationId;
|
|
|
|
|
state.parentMessageId = parentMessageId;
|
2023-02-06 21:17:46 -05:00
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
});
|
2023-02-06 21:18:28 -05:00
|
|
|
//
|
2023-02-06 21:17:46 -05:00
|
|
|
|
|
|
|
|
export const { setConversation } = currentSlice.actions;
|
|
|
|
|
|
|
|
|
|
export default currentSlice.reducer;
|