Merge pull request #1157 from buster-so/big-nate-bus-1952-three-dot-open-in-new-tab-doesnt-do-anything-in-chat

Big nate bus 1952 three dot open in new tab doesnt do anything in chat
This commit is contained in:
Nate Kelley 2025-09-25 16:12:31 -06:00 committed by GitHub
commit 85ce7daf3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 5 deletions

View File

@ -1,4 +1,4 @@
import { useNavigate } from '@tanstack/react-router'; import { useNavigate, useRouter } from '@tanstack/react-router';
import { useMemo } from 'react'; import { useMemo } from 'react';
import type { IBusterChat } from '@/api/asset_interfaces'; import type { IBusterChat } from '@/api/asset_interfaces';
import { useDeleteChat, useDuplicateChat, useGetChat } from '@/api/buster_rest/chats'; import { useDeleteChat, useDuplicateChat, useGetChat } from '@/api/buster_rest/chats';
@ -89,17 +89,23 @@ export const useFavoriteChatSelectMenu = ({ chatId = '' }: { chatId: string | un
}; };
export const useOpenInNewTabSelectMenu = ({ chatId = '' }: { chatId: string | undefined }) => { export const useOpenInNewTabSelectMenu = ({ chatId = '' }: { chatId: string | undefined }) => {
const router = useRouter();
return useMemo(() => { return useMemo(() => {
return createDropdownItem({ return createDropdownItem({
label: 'Open in new tab', label: 'Open in new tab',
value: 'open-in-new-tab', value: 'open-in-new-tab',
icon: <ArrowRight />, icon: <ArrowRight />,
link: { onClick: () => {
to: '/app/chats/$chatId', if (chatId) {
params: { chatId: chatId }, const link = router.buildLocation({
to: '/app/chats/$chatId',
params: { chatId: chatId },
});
window.open(link.href, '_blank');
}
}, },
}); });
}, []); }, [chatId, router.buildLocation]);
}; };
export const useDuplicateChatSelectMenu = ({ chatId = '' }: { chatId: string | undefined }) => { export const useDuplicateChatSelectMenu = ({ chatId = '' }: { chatId: string | undefined }) => {