mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 19:00:13 +01:00
32 lines
752 B
JavaScript
32 lines
752 B
JavaScript
import { createSlice } from '@reduxjs/toolkit';
|
|
|
|
const initialState = {
|
|
error: false,
|
|
title: 'ChatGPT Clone',
|
|
conversationId: null,
|
|
parentMessageId: null,
|
|
conversationSignature: null,
|
|
clientId: null,
|
|
invocationId: null,
|
|
chatGptLabel: null,
|
|
promptPrefix: null,
|
|
convosLoading: false
|
|
};
|
|
|
|
const currentSlice = createSlice({
|
|
name: 'convo',
|
|
initialState,
|
|
reducers: {
|
|
setConversation: (state, action) => {
|
|
return { ...state, ...action.payload };
|
|
},
|
|
setError: (state, action) => {
|
|
state.error = action.payload;
|
|
}
|
|
// setConvos: (state, action) => state.convos = action.payload,
|
|
}
|
|
});
|
|
|
|
export const { setConversation, setConvos, setError } = currentSlice.actions;
|
|
|
|
export default currentSlice.reducer;
|