Advertisement
Guest User

Untitled

a guest
May 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. FirebaseService.getUpcomingGames(this.setTest)
  2.  
  3.  
  4.  
  5. @action async setTest(data) {
  6. let upcomingGamesList = data;
  7. console.log('ucomcing',upcomingGamesList)
  8. let updatededList = await upcomingGamesList.map(async (game) => {
  9. console.log(game)
  10. let GameId = game.GameId
  11. console.log(GameId)
  12. await firebase.database().ref(`GameNotificationPreferances/${GameId}`).orderByKey().equalTo(UserStore.user.uid).on('value', async (snapshot) => {
  13. if (snapshot.val() != null || snapshot.val() != undefined) {
  14. game['reminderPressed'] = true;
  15. } else {
  16. game['reminderPressed'] = false
  17. }
  18. console.log('GameId:', GameId, 'GameDetails:', game)
  19. this.upcomingGamesList.push(game)
  20. })
  21.  
  22. })
  23. console.log(this.upcomingGamesList)
  24.  
  25.  
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement