Skip to content

Commit

Permalink
Surfaced swipe rights
Browse files Browse the repository at this point in the history
  • Loading branch information
vince0656 committed Nov 28, 2019
1 parent a55972a commit 7e3df7e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/components/Chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<small>Your kitties:</small>
<ul>
<li v-for="(kittie, idx) in kitties.user" :key="idx">
<small>{{kittie}}</small>
<small>{{kittie.kittieId}}</small>
<small v-for="(swipeRight, idx) in kittie.swipeRights" :key="idx"> - {{swipeRight.status}} Swipe Right from {{swipeRight.stud}} <button>Accept</button></small>
</li>
</ul>
</div>
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 7e3df7e

Please sign in to comment.