mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 16:30: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 localize = useLocalize();
|
||||
|
||||
const clickHandler = () => {
|
||||
newConvo();
|
||||
newConversation();
|
||||
navigate('new');
|
||||
toggleNav();
|
||||
const clickHandler = (event: React.MouseEvent<HTMLAnchorElement>) => {
|
||||
if (event.button === 0 && !event.ctrlKey) {
|
||||
event.preventDefault();
|
||||
newConvo();
|
||||
newConversation();
|
||||
navigate('new');
|
||||
toggleNav();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<a
|
||||
href="/"
|
||||
data-testid="nav-new-chat-button"
|
||||
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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue