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