mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
chore: switch focus to textarea when custom model change (still need to figure out reg model change)
This commit is contained in:
parent
ff45511011
commit
d052d221dc
3 changed files with 7 additions and 10 deletions
|
|
@ -185,11 +185,11 @@ export default function TextChat({ messages }) {
|
||||||
sender,
|
sender,
|
||||||
};
|
};
|
||||||
console.log('User Input:', message);
|
console.log('User Input:', message);
|
||||||
// handleSubmit(submission);
|
|
||||||
dispatch(setSubmission(submission));
|
dispatch(setSubmission(submission));
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
inputRef.current?.focus();
|
||||||
if (Object.keys(submission).length === 0) {
|
if (Object.keys(submission).length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ export default function TextWrapper({ text, generateCursor }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{result}
|
{result}
|
||||||
{(<>{generateCursor()}</>)}
|
{generateCursor()}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,14 +65,13 @@ export default function ModelMenu() {
|
||||||
localStorage.setItem('model', JSON.stringify(model));
|
localStorage.setItem('model', JSON.stringify(model));
|
||||||
}, [model]);
|
}, [model]);
|
||||||
|
|
||||||
const onChange = (value, custom = false) => {
|
const onChange = (value) => {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return;
|
return;
|
||||||
} else if (value === model) {
|
} else if (value === model) {
|
||||||
return;
|
return;
|
||||||
} else if (value === 'chatgptCustom') {
|
} else if (value === 'chatgptCustom') {
|
||||||
// dispatch(setMessages([]));
|
// return;
|
||||||
return;
|
|
||||||
} else if (initial[value]) {
|
} else if (initial[value]) {
|
||||||
dispatch(setModel(value));
|
dispatch(setModel(value));
|
||||||
dispatch(setDisabled(false));
|
dispatch(setDisabled(false));
|
||||||
|
|
@ -84,9 +83,7 @@ export default function ModelMenu() {
|
||||||
dispatch(setCustomGpt({ chatGptLabel, promptPrefix }));
|
dispatch(setCustomGpt({ chatGptLabel, promptPrefix }));
|
||||||
dispatch(setModel('chatgptCustom'));
|
dispatch(setModel('chatgptCustom'));
|
||||||
dispatch(setCustomModel(value));
|
dispatch(setCustomModel(value));
|
||||||
// if (custom) {
|
setMenuOpen(false);
|
||||||
// setMenuOpen((prevOpen) => !prevOpen);
|
|
||||||
// }
|
|
||||||
} else if (!modelMap[value]) {
|
} else if (!modelMap[value]) {
|
||||||
dispatch(setCustomModel(null));
|
dispatch(setCustomModel(null));
|
||||||
}
|
}
|
||||||
|
|
@ -160,7 +157,7 @@ export default function ModelMenu() {
|
||||||
{icon}
|
{icon}
|
||||||
</Button>
|
</Button>
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent className="w-56 dark:bg-gray-700">
|
<DropdownMenuContent className="w-56 dark:bg-gray-700" onCloseAutoFocus={(event) => event.preventDefault()}>
|
||||||
<DropdownMenuLabel className="dark:text-gray-300">Select a Model</DropdownMenuLabel>
|
<DropdownMenuLabel className="dark:text-gray-300">Select a Model</DropdownMenuLabel>
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuSeparator />
|
||||||
<DropdownMenuRadioGroup
|
<DropdownMenuRadioGroup
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue