rearrange convo fetching for performance in progress

This commit is contained in:
Daniel Avila 2023-02-13 23:14:35 -05:00
parent c00a2c902b
commit e4d1ff2523
5 changed files with 21 additions and 8 deletions

View file

@ -5,6 +5,8 @@ const initialState = {
title: 'ChatGPT Clone',
conversationId: null,
parentMessageId: null,
convos: [],
convosLoading: false,
};
const currentSlice = createSlice({
@ -17,9 +19,10 @@ const currentSlice = createSlice({
setError: (state, action) => {
state.error = action.payload;
},
setConvos: (state, action) => state.convos = action.payload,
}
});
export const { setConversation, setError } = currentSlice.actions;
export const { setConversation, setConvos, setError } = currentSlice.actions;
export default currentSlice.reducer;