Client Fixes (#9050)

* reset yesterdailies array after cron has run

* start to fix gifting

* remove unused code, move encodegift

* wip

* fix styles and bugs

* fix error if amazon is slow to load its script

* fix error notifications not showing up
This commit is contained in:
Matteo Pagliazzi
2017-09-20 15:04:35 +02:00
committed by GitHub
parent dd0c95f051
commit c0f159a8a5
15 changed files with 179 additions and 132 deletions

View File

@@ -152,7 +152,7 @@ export default {
},
},
computed: {
...mapState({user: 'user.data'}),
...mapState({user: 'user.data', credentials: 'credentials'}),
subscriptionBlocksOrdered () {
let subscriptions = filter(subscriptionBlocks, (o) => {
return o.discount !== true;
@@ -273,7 +273,7 @@ export default {
let queryParams = {
_id: this.user._id,
apiToken: this.user.apiToken,
apiToken: this.credentials.API_TOKEN,
noRedirect: true,
};
@@ -290,18 +290,6 @@ export default {
getCancelSubInfo () {
return this.$t(`cancelSubInfo${this.user.purchased.plan.paymentMethod}`);
},
payPalPayment (data) {
if (!this.checkGemAmount(data)) return;
let gift = this.encodeGift(data.giftedTo, data.gift);
let url = `/paypal/checkout?_id=${this.user._id}&apiToken=${this.user.apiToken}&gift=${gift}`;
axios.get(url);
},
encodeGift (uuid, gift) {
gift.uuid = uuid;
let encodedString = JSON.stringify(gift);
return encodeURIComponent(encodedString);
},
},
};
</script>