Purchase Card: fixes (#9803)

* prevent re-showing buy-modal after buying a card / fix class-badge in member-selection

* show notifications on card purchase

* move string to generic.json

* translation param "profileName"
This commit is contained in:
negue
2018-02-05 17:39:42 +01:00
committed by Keith Holliday
parent 65074df668
commit 46877fb20c
3 changed files with 14 additions and 1 deletions
+10
View File
@@ -400,7 +400,16 @@ export default {
if (item.purchaseType === 'card') {
this.selectedSpellToBuy = item;
// hide the dialog
this.$root.$emit('bv::hide::modal', 'buy-modal');
// remove the dialog from our modal-stack,
// the default hidden event is delayed
this.$root.$emit('bv::modal::hidden', {
target: {
id: 'buy-modal',
},
});
this.$root.$emit('bv::show::modal', 'select-member-modal');
}
},
@@ -411,6 +420,7 @@ export default {
if (this.selectedSpellToBuy.pinType === 'card') {
const newUserGp = castResult.data.data.user.stats.gp;
this.$store.state.user.data.stats.gp = newUserGp;
this.text(this.$t('sentCardToUser', { profileName: member.profile.name }));
}
this.selectedSpellToBuy = null;
@@ -19,6 +19,7 @@
position: absolute;
left: calc(50% - (16px));
bottom: -($badge-size / 2);
z-index: 1;
}
.svg-icon {
@@ -52,4 +53,4 @@ export default {
};
},
};
</script>
</script>
+2
View File
@@ -173,6 +173,8 @@
"achievementBewilderText": "Helped defeat the Be-Wilder during the 2016 Spring Fling Event!",
"checkOutProgress": "Check out my progress in Habitica!",
"cards": "Cards",
"sentCardToUser": "You sent a card to <%= profileName %>",
"cardReceivedFrom": "<%= cardType %> from <%= userName %>",
"cardReceived": "You received a <span class=\"notification-bold-blue\"><%= card %></span>",
"greetingCard": "Greeting Card",
"greetingCardExplanation": "You both receive the Cheery Chum achievement!",