mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
fix: don't reset new convo if model not change
fix: change model will clear all messages.
This commit is contained in:
parent
4e91437049
commit
54aa9debb4
1 changed files with 10 additions and 7 deletions
|
|
@ -12,6 +12,8 @@ import ModelDialog from './ModelDialog';
|
|||
import MenuItems from './MenuItems';
|
||||
import { swr } from '~/utils/fetchers';
|
||||
import { setModels } from '~/store/modelSlice';
|
||||
import { setMessages } from '~/store/messageSlice';
|
||||
import { setText } from '~/store/textSlice';
|
||||
import GPTIcon from '../svg/GPTIcon';
|
||||
import BingIcon from '../svg/BingIcon';
|
||||
import { Button } from '../ui/Button.tsx';
|
||||
|
|
@ -64,16 +66,13 @@ export default function ModelMenu() {
|
|||
}, [model]);
|
||||
|
||||
const onChange = (value, custom = false) => {
|
||||
// Set new conversation
|
||||
dispatch(setNewConvo());
|
||||
dispatch(setSubmission({}));
|
||||
// if (custom) {
|
||||
// mutate();
|
||||
// }
|
||||
if (!value) {
|
||||
return;
|
||||
} else if (value === model) {
|
||||
return;
|
||||
} else if (value === 'chatgptCustom') {
|
||||
// dispatch(setMessages([]));
|
||||
return;
|
||||
} else if (initial[value]) {
|
||||
dispatch(setModel(value));
|
||||
dispatch(setDisabled(false));
|
||||
|
|
@ -92,7 +91,11 @@ export default function ModelMenu() {
|
|||
dispatch(setCustomModel(null));
|
||||
}
|
||||
|
||||
|
||||
// Set new conversation
|
||||
dispatch(setText(''));
|
||||
dispatch(setMessages([]));
|
||||
dispatch(setNewConvo());
|
||||
dispatch(setSubmission({}));
|
||||
};
|
||||
|
||||
const onOpenChange = (open) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue