From 4e34e70a117890e35c4e129e2081dce718572de9 Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Sun, 26 Oct 2025 14:24:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=89=8B=E5=8A=A8=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/ui/chat/ChatFragment.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/client/ui/chat/ChatFragment.tsx b/client/ui/chat/ChatFragment.tsx index f784212..0e8b761 100644 --- a/client/ui/chat/ChatFragment.tsx +++ b/client/ui/chat/ChatFragment.tsx @@ -78,7 +78,9 @@ export default function ChatFragment({ target, showReturnButton, onReturnButtonC tabRef.current != null && setTabItemSelected(tabRef.current!.value as string) }) - useAsyncEffect(async () => { + async function getChatInfoAndInit() { + setMessagesList([]) + page.current = 0 const re = await Client.invoke('Chat.getInfo', { token: data.access_token, target: target, @@ -101,7 +103,8 @@ export default function ChatFragment({ target, showReturnButton, onReturnButtonC behavior: "smooth", }) }, 300) - }, [target]) + } + useAsyncEffect(getChatInfoAndInit, [target]) const page = React.useRef(0) async function loadMore() { @@ -222,6 +225,7 @@ export default function ChatFragment({ target, showReturnButton, onReturnButtonC for (const file of files) { addFile(file.type, file.name, file) } + uploadChatAvatarRef.current!.value = '' }) useEventListener(uploadChatAvatarRef, 'change', async (_e) => { const file = uploadChatAvatarRef.current!.files?.[0] as File @@ -232,6 +236,7 @@ export default function ChatFragment({ target, showReturnButton, onReturnButtonC target: target, avatar: file }) + uploadChatAvatarRef.current!.value = '' if (checkApiSuccessOrSncakbar(re, "修改失败")) return snackbar({ @@ -283,6 +288,11 @@ export default function ChatFragment({ target, showReturnButton, onReturnButtonC
+ getChatInfoAndInit()} style={{ + alignSelf: 'center', + marginLeft: '5px', + marginRight: '5px', + }}> openChatInfoDialog(chatInfo)} style={{ alignSelf: 'center', marginLeft: '5px',