convo fetching in increments of 12

This commit is contained in:
Daniel Avila 2023-03-05 14:41:50 -05:00
parent 80319c7fcc
commit a98367d27f
6 changed files with 70 additions and 16 deletions

View file

@ -10,7 +10,9 @@ const initialState = {
invocationId: null,
chatGptLabel: null,
promptPrefix: null,
convosLoading: false
convosLoading: false,
pageNumber: 1,
convos: [],
};
const currentSlice = createSlice({
@ -22,11 +24,14 @@ const currentSlice = createSlice({
},
setError: (state, action) => {
state.error = action.payload;
},
incrementPage: (state) => {
state.pageNumber = state.pageNumber + 1;
}
// setConvos: (state, action) => state.convos = action.payload,
}
});
export const { setConversation, setConvos, setError } = currentSlice.actions;
export const { setConversation, setConvos, setError, incrementPage } = currentSlice.actions;
export default currentSlice.reducer;