当用户更改他的个人资料图片时,它不会更新,直到他们重新加载页面......这是 y 代码:
const handleProfile = async (e: any) => {
const file = e.target.files[0]
const storageRef = firebase
.storage()
.ref(`/profile/${user?.id}/${user?.username}`)
const task = storageRef.put(file)
task.on('state_changed', () => {
storage()
.ref(`/profile/${user?.id}/${user?.username}`)
.getDownloadURL()
.then((url) => updateUser({ img: url }))
})
}
我试过:
setTimeOut(() => {
location.reload}, 200)
但它不起作用
哔哔one
江户川乱折腾
ABOUTYOU
相关分类