fix structure

This commit is contained in:
Jacob Levine 2019-03-07 19:55:30 -06:00
parent b5d8851c44
commit 0684f982b7

View File

@ -106,17 +106,20 @@ function reqjt(tn,tc){
push[tn]='scout'; push[tn]='scout';
firebase.firestore().collection("UserAssociations").doc(user.uid).set(push, { firebase.firestore().collection("UserAssociations").doc(user.uid).set(push, {
merge: true merge: true
}).then(function(doc) { }).then(function() {
if (doc.exists) { teamAssoc = firebase.firestore().collection('UserAssociations').doc(user.uid)
list = doc.data() teamAssoc.get().then(function(doc) {
teamNums = Object.keys(list) if (doc.exists) {
document.getElementById('teammem').innerHTML = "" list = doc.data()
for (var i = 0; i < teamNums.length; i++) { teamNums = Object.keys(list)
document.getElementById('teammem').innerHTML += "<tr><td>" + teamNums[i] + "</td><td>" + list[teamNums[i]] + "</td></tr>" document.getElementById('teammem').innerHTML = ""
for (var i = 0; i < teamNums.length; i++) {
document.getElementById('teammem').innerHTML += "<tr><td>" + teamNums[i] + "</td><td>" + list[teamNums[i]] + "</td></tr>"
}
} else {
document.getElementById('teammem').innerHTML = "<tr><td>You are not part of any teams</td></tr>"
} }
} else { })
document.getElementById('teammem').innerHTML = "<tr><td>You are not part of any teams</td></tr>"
}
}) })
}else{ }else{
alert("You don't have a correct join key. Please check it and try again.") alert("You don't have a correct join key. Please check it and try again.")