mirror of
https://github.com/urosran/cally.git
synced 2025-11-26 00:24:53 +00:00
- Fixed issue with uploading images for other users
This commit is contained in:
@ -39,10 +39,15 @@ export const useChangeProfilePicture = (customUserId?: string) => {
|
||||
console.log("Download URL:", downloadURL);
|
||||
|
||||
if(!customUserId) {
|
||||
await firestore()
|
||||
.collection("Profiles")
|
||||
.doc(user?.uid)
|
||||
.update({pfp: downloadURL});
|
||||
await firestore()
|
||||
.collection("Profiles")
|
||||
.doc(user?.uid)
|
||||
.update({pfp: downloadURL});
|
||||
} else {
|
||||
await firestore()
|
||||
.collection("Profiles")
|
||||
.doc(customUserId)
|
||||
.update({pfp: downloadURL});
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
@ -55,6 +60,8 @@ export const useChangeProfilePicture = (customUserId?: string) => {
|
||||
if (!customUserId) {
|
||||
queryClient.invalidateQueries({queryKey: ["Profiles"]});
|
||||
refreshProfileData();
|
||||
} else {
|
||||
queryClient.invalidateQueries({queryKey: ["Profiles"]});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user