From f0b22eff64390644293cdff2acaf3eff0f4f3997 Mon Sep 17 00:00:00 2001 From: Cogent Apps Date: Mon, 20 Mar 2023 14:18:25 +0000 Subject: [PATCH] possible fix for delete button --- app/src/components/sidebar/recent-chats.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/components/sidebar/recent-chats.tsx b/app/src/components/sidebar/recent-chats.tsx index f0635a2..3127430 100644 --- a/app/src/components/sidebar/recent-chats.tsx +++ b/app/src/components/sidebar/recent-chats.tsx @@ -131,7 +131,13 @@ export default function RecentChats(props: any) { const currentChatID = context.currentChat.chat?.id; const recentChats = context.chat.search.query(''); - const onClick = useCallback(() => { + const onClick = useCallback((e: React.MouseEvent) => { + if (e.currentTarget.closest('button')) { + e.preventDefault(); + e.stopPropagation(); + return; + } + if (window.matchMedia('(max-width: 40em)').matches) { dispatch(toggleSidebar()); }