From 19ed8c035730326bb6eef70f5c37dc16c701866e Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Sun, 14 Dec 2025 00:38:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BF=AE=E6=94=B9=E8=B5=84?= =?UTF-8?q?=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/ui/routers/EditMyProfileDialog.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/client/ui/routers/EditMyProfileDialog.tsx b/client/ui/routers/EditMyProfileDialog.tsx index aec8be6..ea99f9e 100644 --- a/client/ui/routers/EditMyProfileDialog.tsx +++ b/client/ui/routers/EditMyProfileDialog.tsx @@ -32,16 +32,19 @@ export default function EditMyProfileDialog() { fileData: file, }) await mySelf?.setAvatarFileHashOrThrow(hash) + showSnackbar({ + message: "修改成功, 刷新页面以更新", + }) } catch (e) { + console.error(e) if (e instanceof CallbackError) showSnackbar({ message: '上传头像失败: ' + e.message }) + showSnackbar({ + message: '上传头像失败: ' + (e instanceof Error ? e.message : e) + }) } - - showSnackbar({ - message: "修改成功, 刷新页面以更新", - }) }) return ( @@ -57,7 +60,10 @@ export default function EditMyProfileDialog() { display: 'flex', alignItems: 'center', }}> - { + chooseAvatarFileRef.current!.value = '' + chooseAvatarFileRef.current!.click() + }} style={{ width: '50px', height: '50px', }} />