修正修改资料

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