Last active
July 27, 2018 10:42
-
-
Save netgfx/605b518289d2124e3fa666f73de1db03 to your computer and use it in GitHub Desktop.
medium-pending-challenge-3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var pendingChallenges = []; | |
| FirebaseAPI.db.collection("pendingChallenges").where("pendingParty.id", "==", facebookStuff.userId).get().then(function(pendingChallengesDoc) { | |
| console.log(pendingChallengesDoc, pendingChallengesDoc.size); | |
| if (pendingChallengesDoc.empty === true && pendingChallengesDoc.size > 0) { | |
| if (fn) { | |
| fn(pendingChallenges); | |
| } | |
| } else { | |
| pendingChallengesDoc.forEach(function(item) { | |
| pendingChallenges.push(item); | |
| }); | |
| if (fn) { | |
| fn(pendingChallenges); | |
| } | |
| } | |
| }).catch(function(err) { | |
| if (fn) { | |
| fn([]); | |
| } | |
| console.log("error: ", err.message); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment