prompt prefix and label state changes when customGpt selected

This commit is contained in:
Daniel Avila 2023-03-04 18:00:12 -05:00
parent 9c3a78f96b
commit b4b0c123ba
3 changed files with 28 additions and 27 deletions

View file

@ -2,7 +2,7 @@
import React, { useState, useRef } from 'react';
import TextareaAutosize from 'react-textarea-autosize';
import { useDispatch } from 'react-redux';
import { setModel, setDisabled, setCustomGpt } from '~/store/submitSlice';
import { setModel, setCustomGpt } from '~/store/submitSlice';
import manualSWR from '~/utils/fetchers';
import { Button } from '../ui/Button.tsx';
import { Input } from '../ui/Input.tsx';
@ -35,7 +35,7 @@ export default function ModelDialog({ mutate }) {
}
dispatch(setCustomGpt({ chatGptLabel, promptPrefix }));
dispatch(setModel('chatgptCustom'));
dispatch(setDisabled(false));
// dispatch(setDisabled(false));
};
const saveHandler = (e) => {
@ -56,8 +56,8 @@ export default function ModelDialog({ mutate }) {
setSaveText('Save');
}, 2500);
// dispatch(setCustomGpt({ chatGptLabel, promptPrefix }));
// dispatch(setModel('chatgptCustom'));
dispatch(setCustomGpt({ chatGptLabel, promptPrefix }));
dispatch(setModel('chatgptCustom'));
// dispatch(setDisabled(false));
};