mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2024-12-27 09:59:10 +00:00
test bugfix
This commit is contained in:
parent
3e76c55801
commit
b0782ed74e
@ -98,36 +98,36 @@ function checkKeyMatch(dt,tn,key){
|
|||||||
}
|
}
|
||||||
function reqjt(tn,tc){
|
function reqjt(tn,tc){
|
||||||
user=firebase.auth().currentUser;
|
user=firebase.auth().currentUser;
|
||||||
dict={}
|
|
||||||
firebase.firestore().collection('teamData').doc('joinCodes').get().then(function(doc){
|
firebase.firestore().collection('teamData').doc('joinCodes').get().then(function(doc){
|
||||||
if (doc.exists) {
|
if (doc.exists) {
|
||||||
dict=doc.data();
|
dict=doc.data();
|
||||||
|
if (checkKeyMatch(dict,tn,tc)){
|
||||||
|
push={};
|
||||||
|
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 += "<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{
|
||||||
|
alert("You don't have a correct join key. Please check it and try again.")
|
||||||
|
console.log(dict)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// doc.data() will be undefined in this case
|
// doc.data() will be undefined in this case
|
||||||
console.log("No such document!");
|
console.log("No such document!");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (checkKeyMatch(dict,tn,tc)){
|
|
||||||
push={};
|
|
||||||
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 += "<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{
|
|
||||||
alert("You don't have a correct join key. Please check it and try again.")
|
|
||||||
console.log(dict)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function signout() {
|
function signout() {
|
||||||
|
Loading…
Reference in New Issue
Block a user