From 65602f09f2a7529fffda68d360b839ce9ded094b Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Sun, 23 Nov 2025 00:42:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=96=99=E5=8D=A1=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E6=88=96=E7=94=A8=E6=88=B7=20id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/ui/dialog/ChatInfoDialog.tsx | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/client/ui/dialog/ChatInfoDialog.tsx b/client/ui/dialog/ChatInfoDialog.tsx index 1ab4046..8f682dc 100644 --- a/client/ui/dialog/ChatInfoDialog.tsx +++ b/client/ui/dialog/ChatInfoDialog.tsx @@ -25,7 +25,7 @@ export default function ChatInfoDialog({ chat, chatInfoDialogRef, openChatFragme setIsFavourited(sharedFavouriteChats.map((v) => v.id).indexOf(chat?.id || '') != -1) }) - let userId: string | null = null + const [userId, setUserId] = React.useState(null) useAsyncEffect(async () => { if (chat?.type == 'private') { const re = await Client.invoke("Chat.getAnotherUserIdFromPrivate", { @@ -34,7 +34,7 @@ export default function ChatInfoDialog({ chat, chatInfoDialogRef, openChatFragme }) if (re.code != 200) return checkApiSuccessOrSncakbar(re, '获取用户失败') - userId = re.data!.user_id as string + setUserId(re.data!.user_id as string) } }, [chat, sharedFavouriteChats]) @@ -50,10 +50,22 @@ export default function ChatInfoDialog({ chat, chatInfoDialogRef, openChatFragme width: '50px', height: '50px', }} onClick={() => avatarUrl && openImageViewer(avatarUrl)} /> - {chat?.title} + flexDirection: 'column', + }}> + {chat?.title} + ID: {chat?.type == 'private' ? userId : chat?.id} + {favourited ? '取消收藏' : '收藏对话'} { chatInfoDialogRef.current!.open = false - openChatFragment(chat.id) + openChatFragment(chat!.id) }}>打开对话