From 7e3df7eab0ee40b005796219f23e845826b8067b Mon Sep 17 00:00:00 2001 From: Vincent de Almeida Date: Thu, 28 Nov 2019 12:10:18 +0000 Subject: [PATCH] Surfaced swipe rights --- src/components/Chat.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/Chat.vue b/src/components/Chat.vue index 7c98fb7..6c6a0fb 100644 --- a/src/components/Chat.vue +++ b/src/components/Chat.vue @@ -6,7 +6,8 @@ Your kitties: @@ -89,16 +90,18 @@ }, getUserKitties: async function() { this.kitties.user = await KittiesService.getAllKittiesForAddress('mainnet', this.accounts.user); - this.getSwipeRightForUserKitties(); + this.getAllSwipeRightsForKittie(); }, - getSwipeRightForUserKitties: async function() { - const swipeRightsForAllKitties = await Promise.all(this.kitties.user.map(async kittie => + getAllSwipeRightsForKittie: async function() { + // todo - move this into the Kitties Service + const kittiesWithSwipeRights = await Promise.all(this.kitties.user.map(async kittie => ({ kittieId: kittie, swipeRights: await KittiesService.getAllSwipeRightsForKittie('mainnet', kittie) }) )); - console.log('swipeRightsForAllKitties', swipeRightsForAllKitties); + this.kitties.user = kittiesWithSwipeRights; + console.log('swipeRightsForAllKitties', kittiesWithSwipeRights); } }, async mounted() {