当用户更改他的个人资料图片时,它不会更新,直到他们重新加载页面......这是 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)但它不起作用
添加回答
举报
0/150
提交
取消