mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2024-12-28 10:09:09 +00:00
fix mistake
This commit is contained in:
parent
61b286c258
commit
eb20ad907e
@ -140,27 +140,26 @@ function reqjt(tn, tc) {
|
|||||||
function leaveTeam(tn) {
|
function leaveTeam(tn) {
|
||||||
teamAssoc = firebase.firestore().collection('UserAssociations').doc(user.uid)
|
teamAssoc = firebase.firestore().collection('UserAssociations').doc(user.uid)
|
||||||
teamAssoc.get().then(function(doc) {
|
teamAssoc.get().then(function(doc) {
|
||||||
if (doc.exists) {
|
if (doc.exists) {
|
||||||
list = doc.data()
|
list = doc.data()
|
||||||
delete list[tn]
|
delete list[tn]
|
||||||
firebase.firestore().collection("UserAssociations").doc(user.uid).set(list).then(function() {
|
firebase.firestore().collection("UserAssociations").doc(user.uid).set(list).then(function() {
|
||||||
teamAssoc = firebase.firestore().collection('UserAssociations').doc(user.uid)
|
teamAssoc = firebase.firestore().collection('UserAssociations').doc(user.uid)
|
||||||
teamAssoc.get().then(function(doc) {
|
teamAssoc.get().then(function(doc) {
|
||||||
if (doc.exists) {
|
if (doc.exists) {
|
||||||
list = doc.data()
|
list = doc.data()
|
||||||
teamNums = Object.keys(list)
|
teamNums = Object.keys(list)
|
||||||
document.getElementById('teammem').innerHTML = ""
|
document.getElementById('teammem').innerHTML = ""
|
||||||
for (var i = 0; i < teamNums.length; i++) {
|
for (var i = 0; i < teamNums.length; i++) {
|
||||||
document.getElementById('teammem').innerHTML += "<tr><td>" + teamNums[i] + "</td><td>" + list[teamNums[i]] + "</td>" + "<td><input type='button' class='btn' value='leave' onclick='leaveTeam(" + teamNums[i] + ")'></td></tr>"
|
document.getElementById('teammem').innerHTML += "<tr><td>" + teamNums[i] + "</td><td>" + list[teamNums[i]] + "</td>" + "<td><input type='button' class='btn' value='leave' onclick='leaveTeam(" + 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>"
|
||||||
|
}
|
||||||
})
|
})
|
||||||
)
|
})
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
|
|
||||||
function signout() {
|
function signout() {
|
||||||
var user = firebase.auth().currentUser;
|
var user = firebase.auth().currentUser;
|
||||||
|
Loading…
Reference in New Issue
Block a user