Skip to content

Commit

Permalink
Removed hard coded user addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
vince0656 committed Nov 29, 2019
1 parent 2d3b905 commit f413cfc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/Chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
onFCMTokenReceived: async function (token) {
if (token) {
console.log('token', token);
await Accounts.upsertFirebaseMessagingTokenForAccount('0x401cBf2194D35D078c0BcdAe4BeA42275483ab5F'.toLowerCase(), token);
await Accounts.upsertFirebaseMessagingTokenForAccount(this.accounts.user.toLowerCase(), token);
} else {
console.log('Unable to retrieve token - check permissions');
}
Expand All @@ -94,7 +94,7 @@
name
};
const msg = `Want to breed with ${studPayload.name}?`;
await KittiesService.swipeRight('mainnet', kittieId, studPayload, msg, '0x401cBf2194D35D078c0BcdAe4BeA42275483ab5F'.toLowerCase());
await KittiesService.swipeRight('mainnet', kittieId, studPayload, msg, this.accounts.user.toLowerCase());
console.log(`swipe right from ${studPayload.id} to ${kittieId}`);
},
Expand All @@ -106,15 +106,15 @@
this.kitties.other = await KittiesService.getAllKittiesForAddress('mainnet', this.accounts.other.toLowerCase());
},
getUserKitties: async function() {
const kitties = (await axios.get('https://api.cryptokitties.co/v2/kitties?offset=0&limit=12&owner_wallet_address=0x401cBf2194D35D078c0BcdAe4BeA42275483ab5F&parents=false&authenticated=true&include=sale,sire,other&orderBy=id&orderDirection=desc')).data.kitties;
const cryptoKittiesApiEndpoint = `https://api.cryptokitties.co/v2/kitties?offset=0&limit=12&owner_wallet_address=${this.accounts.user}&parents=false&authenticated=true&include=sale,sire,other&orderBy=id&orderDirection=desc`;
const kitties = (await axios.get(cryptoKittiesApiEndpoint)).data.kitties;
this.kitties.userSelected = kitties[0].id.toString();
this.kitties.user = kitties;
this.upsertKittiesAndGetSwipeRights(kitties);
//this.kitties.user = await KittiesService.getAllKittiesWithSwipeRightsForAddress('mainnet', /*this.accounts.user*/'0x401cBf2194D35D078c0BcdAe4BeA42275483ab5F');
},
upsertKittiesAndGetSwipeRights: async function(kitties) {
await KittiesService.upsertKitties('mainnet', kitties);
this.kitties.user = await KittiesService.getAllKittiesWithSwipeRightsForAddress('mainnet', '0x401cBf2194D35D078c0BcdAe4BeA42275483ab5F'.toLowerCase());
this.kitties.user = await KittiesService.getAllKittiesWithSwipeRightsForAddress('mainnet', this.accounts.user.toLowerCase());
this.kitties.userSelected = this.kitties.user[0].id.toString();
console.log(this.kitties.user);
},
Expand Down

0 comments on commit f413cfc

Please sign in to comment.