mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
fix(g1g1): correct blank private message
This commit is contained in:
@@ -344,7 +344,7 @@ describe('payments/index', () => {
|
|||||||
const msg = '`Hello sender, you received 3 months of subscription as part of our holiday gift-giving promotion!`';
|
const msg = '`Hello sender, you received 3 months of subscription as part of our holiday gift-giving promotion!`';
|
||||||
|
|
||||||
expect(user.sendMessage).to.be.calledTwice;
|
expect(user.sendMessage).to.be.calledTwice;
|
||||||
expect(user.sendMessage).to.be.calledWith(user, { senderMsg: msg, save: false });
|
expect(user.sendMessage).to.be.calledWith(user, { receiverMsg: msg, save: false });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,21 +11,21 @@
|
|||||||
@click="showSelectUser"
|
@click="showSelectUser"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
v-once
|
||||||
class="svg-icon svg-gifts left-gift"
|
class="svg-icon svg-gifts left-gift"
|
||||||
v-html="icons.gifts"
|
v-html="icons.gifts"
|
||||||
v-once
|
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
v-once
|
||||||
class="announce-text"
|
class="announce-text"
|
||||||
v-html="$t('g1g1Announcement')"
|
v-html="$t('g1g1Announcement')"
|
||||||
v-once
|
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
v-once
|
||||||
class="svg-icon svg-gifts right-gift"
|
class="svg-icon svg-gifts right-gift"
|
||||||
v-html="icons.gifts"
|
v-html="icons.gifts"
|
||||||
v-once
|
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -103,12 +103,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="col-md-7"
|
|
||||||
v-if="currentEvent && currentEvent.promo && currentEvent.promo === 'g1g1'"
|
v-if="currentEvent && currentEvent.promo && currentEvent.promo === 'g1g1'"
|
||||||
|
class="col-md-7"
|
||||||
>
|
>
|
||||||
<h4 v-once> {{ $t('winterPromoGiftHeader') }} </h4>
|
<h4 v-once>
|
||||||
<p v-once> {{ $t('winterPromoGiftDetails1') }} </p>
|
{{ $t('winterPromoGiftHeader') }}
|
||||||
<p v-once> {{ $t('winterPromoGiftDetails2') }} </p>
|
</h4>
|
||||||
|
<p v-once>
|
||||||
|
{{ $t('winterPromoGiftDetails1') }}
|
||||||
|
</p>
|
||||||
|
<p v-once>
|
||||||
|
{{ $t('winterPromoGiftDetails2') }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -309,15 +309,22 @@
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="currentEvent && currentEvent.promo && currentEvent.promo === 'g1g1'"
|
v-if="currentEvent && currentEvent.promo && currentEvent.promo === 'g1g1'"
|
||||||
class="m-5">
|
class="m-5"
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="currentEvent && currentEvent.promo && currentEvent.promo === 'g1g1'"
|
v-if="currentEvent && currentEvent.promo && currentEvent.promo === 'g1g1'"
|
||||||
class="ml-5 mt-3"
|
class="ml-5 mt-3"
|
||||||
>
|
>
|
||||||
<h2 v-once> {{ $t('winterPromoGiftHeader') }} </h2>
|
<h2 v-once>
|
||||||
<p v-once> {{ $t('winterPromoGiftDetails1') }} </p>
|
{{ $t('winterPromoGiftHeader') }}
|
||||||
<p v-once> {{ $t('winterPromoGiftDetails2') }} </p>
|
</h2>
|
||||||
|
<p v-once>
|
||||||
|
{{ $t('winterPromoGiftDetails1') }}
|
||||||
|
</p>
|
||||||
|
<p v-once>
|
||||||
|
{{ $t('winterPromoGiftDetails2') }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -198,13 +198,13 @@ async function createSubscription (data) {
|
|||||||
// generate the message in both languages, so both users can understand it
|
// generate the message in both languages, so both users can understand it
|
||||||
const languages = [data.user.preferences.language, data.gift.member.preferences.language];
|
const languages = [data.user.preferences.language, data.gift.member.preferences.language];
|
||||||
if (data.promo) {
|
if (data.promo) {
|
||||||
let senderMsg = shared.i18n.t(`giftedSubscription${data.promo}Promo`, {
|
let receiverMsg = shared.i18n.t(`giftedSubscription${data.promo}Promo`, {
|
||||||
username: data.gift.member.profile.name,
|
username: data.gift.member.profile.name,
|
||||||
monthCount: shared.content.subscriptionBlocks[data.gift.subscription.key].months,
|
monthCount: shared.content.subscriptionBlocks[data.gift.subscription.key].months,
|
||||||
}, languages[0]);
|
}, languages[0]);
|
||||||
|
|
||||||
senderMsg = `\`${senderMsg}\``;
|
receiverMsg = `\`${receiverMsg}\``;
|
||||||
data.user.sendMessage(data.gift.member, { senderMsg, save: false });
|
data.user.sendMessage(data.gift.member, { receiverMsg, save: false });
|
||||||
} else {
|
} else {
|
||||||
let senderMsg = shared.i18n.t('giftedSubscriptionFull', {
|
let senderMsg = shared.i18n.t('giftedSubscriptionFull', {
|
||||||
username: data.gift.member.profile.name,
|
username: data.gift.member.profile.name,
|
||||||
|
|||||||
Reference in New Issue
Block a user