mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🗨️ refactor: Open New Tab for Ctrl+Click or Button Combo in NewChat (#1484)
This commit is contained in:
parent
e1a529b5ae
commit
42f2353509
1 changed files with 9 additions and 5 deletions
|
|
@ -6,15 +6,19 @@ export default function NewChat({ toggleNav }: { toggleNav: () => void }) {
|
||||||
const navigate = useOriginNavigate();
|
const navigate = useOriginNavigate();
|
||||||
const localize = useLocalize();
|
const localize = useLocalize();
|
||||||
|
|
||||||
const clickHandler = () => {
|
const clickHandler = (event: React.MouseEvent<HTMLAnchorElement>) => {
|
||||||
newConvo();
|
if (event.button === 0 && !event.ctrlKey) {
|
||||||
newConversation();
|
event.preventDefault();
|
||||||
navigate('new');
|
newConvo();
|
||||||
toggleNav();
|
newConversation();
|
||||||
|
navigate('new');
|
||||||
|
toggleNav();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
|
href="/"
|
||||||
data-testid="nav-new-chat-button"
|
data-testid="nav-new-chat-button"
|
||||||
onClick={clickHandler}
|
onClick={clickHandler}
|
||||||
className="flex h-11 flex-shrink-0 flex-grow cursor-pointer items-center gap-3 rounded-md border border-white/20 px-3 py-3 text-sm text-white transition-colors duration-200 hover:bg-gray-500/10"
|
className="flex h-11 flex-shrink-0 flex-grow cursor-pointer items-center gap-3 rounded-md border border-white/20 px-3 py-3 text-sm text-white transition-colors duration-200 hover:bg-gray-500/10"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue