customGpts persist through localStorage

This commit is contained in:
Daniel Avila 2023-03-04 17:39:06 -05:00
parent 62bb6ea8f8
commit 9c3a78f96b
22 changed files with 405 additions and 220 deletions

View file

@ -3,18 +3,22 @@ import { createSlice } from '@reduxjs/toolkit';
const initialState = {
models: [
{
_id: '0',
name: 'ChatGPT',
value: 'chatgpt'
},
{
_id: '1',
name: 'CustomGPT',
value: 'chatgptCustom'
},
{
_id: '2',
name: 'BingAI',
value: 'bingai'
},
{
_id: '3',
name: 'ChatGPT',
value: 'chatgptBrowser'
}
@ -26,7 +30,8 @@ const currentSlice = createSlice({
initialState,
reducers: {
setModels: (state, action) => {
state.models = [...state.models, ...action.payload];
console.log('setModels', action.payload);
state.models = [...initialState.models, ...action.payload];
}
}
});