From 687088a2842387fd7a85d688eacc6fc2ceafa03f Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Fri, 9 Jan 2026 22:46:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=88=E5=B9=B6=E5=AF=B9?= =?UTF-8?q?=E8=AF=9D=E6=B6=88=E6=81=AF=E5=AF=BC=E8=87=B4=E7=9A=84=E5=8F=B3?= =?UTF-8?q?=E9=94=AE=E8=8F=9C=E5=8D=95=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/ui/app-state/AppStateContextWrapper.tsx | 2 +- client/ui/chat-fragment/ChatFragment.tsx | 8 ++++++-- client/ui/chat-fragment/ChatMessage.tsx | 5 ++--- client/utils/useEventListener.ts | 2 ++ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/client/ui/app-state/AppStateContextWrapper.tsx b/client/ui/app-state/AppStateContextWrapper.tsx index accbd98..cc35c56 100644 --- a/client/ui/app-state/AppStateContextWrapper.tsx +++ b/client/ui/app-state/AppStateContextWrapper.tsx @@ -84,7 +84,7 @@ export default function DialogContextWrapper({ children, useRef }: { children: R setCurrentSelectedChatId('') } }}> - {} + diff --git a/client/ui/chat-fragment/ChatFragment.tsx b/client/ui/chat-fragment/ChatFragment.tsx index c1d6692..b99fab4 100644 --- a/client/ui/chat-fragment/ChatFragment.tsx +++ b/client/ui/chat-fragment/ChatFragment.tsx @@ -77,13 +77,13 @@ export default function ChatFragment({ display: "flex", flexDirection: "column", }}> - {/* { + { openedInDialog && AppState.closeChat()} style={{ alignSelf: 'center', marginLeft: '5px', marginRight: '5px', }}> - } */} + } + { + /* { window.open('/chat?id=' + chatInfo.getId(), '_blank') }} style={{ @@ -112,6 +114,8 @@ export default function ChatFragment({ marginLeft: '5px', marginRight: '5px', }}> + */ + } { }} style={{ diff --git a/client/ui/chat-fragment/ChatMessage.tsx b/client/ui/chat-fragment/ChatMessage.tsx index 72cfae0..c4d9104 100644 --- a/client/ui/chat-fragment/ChatMessage.tsx +++ b/client/ui/chat-fragment/ChatMessage.tsx @@ -170,10 +170,9 @@ export default function ChatMessage({ message, noUserDisplay, avatarMenuItems, m flexDirection: "column" }}> { - !noUserDisplay && -
{ diff --git a/client/utils/useEventListener.ts b/client/utils/useEventListener.ts index 54e0ff5..c8770f8 100644 --- a/client/utils/useEventListener.ts +++ b/client/utils/useEventListener.ts @@ -1,7 +1,9 @@ import * as React from 'react' export default function useEventListener(ref: React.MutableRefObject, eventName: string, callback: (event: Event) => void) { + // console.error(ref, eventName, callback) React.useEffect(() => { + // console.warn(ref, eventName, callback) ref.current!.addEventListener(eventName, callback) return () => ref.current?.removeEventListener(eventName, callback) }, [ref, eventName, callback])