修正修改资料

This commit is contained in:
CrescentLeaf
2025-12-14 00:38:43 +08:00
parent a66d137773
commit 19ed8c0357

View File

@@ -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: "修改成功, 刷新页面以更新",
message: '上传头像失败: ' + (e instanceof Error ? e.message : e)
})
}
})
return (
@@ -57,7 +60,10 @@ export default function EditMyProfileDialog() {
display: 'flex',
alignItems: 'center',
}}>
<AvatarMySelf style={{
<AvatarMySelf onClick={() => {
chooseAvatarFileRef.current!.value = ''
chooseAvatarFileRef.current!.click()
}} style={{
width: '50px',
height: '50px',
}} />