當用戶更改他的個人資料圖片時,它不會更新,直到他們重新加載頁面......這是 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)但它不起作用
如何在不重新加載的情況下更新 firebase 更改
qq_笑_17
2023-03-24 15:18:26