mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 17:30:16 +01:00
chore: model menu functions behave as expected
This commit is contained in:
parent
191118b90b
commit
6be037323e
9 changed files with 157 additions and 35 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useState, useRef } from 'react';
|
||||
import TextareaAutosize from 'react-textarea-autosize';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { useSelector, useDispatch } from 'react-redux';
|
||||
import { setModel, setCustomGpt } from '~/store/submitSlice';
|
||||
import manualSWR from '~/utils/fetchers';
|
||||
import { Button } from '../ui/Button.tsx';
|
||||
|
|
@ -16,8 +16,9 @@ import {
|
|||
DialogTitle
|
||||
} from '../ui/Dialog.tsx';
|
||||
|
||||
export default function ModelDialog({ mutate, modelMap, setModelSave, handleSaveState }) {
|
||||
export default function ModelDialog({ mutate, setModelSave, handleSaveState }) {
|
||||
const dispatch = useDispatch();
|
||||
const { modelMap, initial } = useSelector((state) => state.models);
|
||||
const [chatGptLabel, setChatGptLabel] = useState('');
|
||||
const [promptPrefix, setPromptPrefix] = useState('');
|
||||
const [saveText, setSaveText] = useState('Save');
|
||||
|
|
@ -65,9 +66,12 @@ export default function ModelDialog({ mutate, modelMap, setModelSave, handleSave
|
|||
if (
|
||||
chatGptLabel !== 'chatgptCustom' &&
|
||||
modelMap[chatGptLabel.toLowerCase()] &&
|
||||
!initial[chatGptLabel.toLowerCase()] &&
|
||||
saveText === 'Save'
|
||||
) {
|
||||
setSaveText('Update');
|
||||
} else if (!modelMap[chatGptLabel.toLowerCase()] && saveText === 'Update') {
|
||||
setSaveText('Save');
|
||||
}
|
||||
|
||||
const requiredProp = required ? { required: true } : {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue