From 525e337bcfb1b49327650973608d90c245b65aad Mon Sep 17 00:00:00 2001 From: Stevie Dean Date: Sat, 29 Jul 2023 22:58:54 -0700 Subject: [PATCH] small fix --- mainModule.js | 2 +- server.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/mainModule.js b/mainModule.js index bf156d7..4d69301 100644 --- a/mainModule.js +++ b/mainModule.js @@ -53,7 +53,7 @@ onAuthStateChanged(auth, (user) => { window.location.href = "index.html"; } else { - localStorage.setItem("community", community); + localStorage.setItem("community", data.community); // Add in the crushes. for (let crush of data.crushes) { document.getElementById("crushesHTML").innerHTML += diff --git a/server.js b/server.js index 35be1ee..5ea54f4 100644 --- a/server.js +++ b/server.js @@ -302,7 +302,6 @@ app.post("/addCrush", async (req, res) => { if (crush != null) { if (crush.uid == uid) { matches++; - break; } } } @@ -319,8 +318,8 @@ app.post("/addCrush", async (req, res) => { } if (!admirerAlreadyExists) { // Update the other person's admirers. - adList.push({ uid: uid, year: myYear }); - database.ref(`users/${community}/${person}`).update({ admirers: adList }) + admirerList.push({ uid: uid, year: myYear }); + database.ref(`users/${community}/${person}`).update({ admirers: admirerList }) } // Add to current person's crushes.