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.