From 5629dc88362d14dd60ab32a13e28056ef4a45910 Mon Sep 17 00:00:00 2001 From: Nicholas Pease Date: Sun, 7 Apr 2024 23:31:18 -0400 Subject: [PATCH] Bug Fix - Profile Editing --- frontend-next/src/components/app/profile/ProfileEdit.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend-next/src/components/app/profile/ProfileEdit.js b/frontend-next/src/components/app/profile/ProfileEdit.js index 5845302..6a3895c 100644 --- a/frontend-next/src/components/app/profile/ProfileEdit.js +++ b/frontend-next/src/components/app/profile/ProfileEdit.js @@ -45,12 +45,11 @@ export function ProfileEdit({ profileData, user, onSave }) { } ); } else { - for (var key in data) { - if (data[key] == "") { + for (var key in profileData) { + if (data[key] == "" || (key == "pfp" && data[key].length == 0)) { data[key] = profileData[key]; } } - data.pfp = profileData.pfp; handleEditState(false); update(ref(database, `users/${user.uid}`), data); }