mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 06:07:21 +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!`';
|
||||
|
||||
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"
|
||||
>
|
||||
<div
|
||||
v-once
|
||||
class="svg-icon svg-gifts left-gift"
|
||||
v-html="icons.gifts"
|
||||
v-once
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
v-once
|
||||
class="announce-text"
|
||||
v-html="$t('g1g1Announcement')"
|
||||
v-once
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
v-once
|
||||
class="svg-icon svg-gifts right-gift"
|
||||
v-html="icons.gifts"
|
||||
v-once
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -103,12 +103,18 @@
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="col-md-7"
|
||||
v-if="currentEvent && currentEvent.promo && currentEvent.promo === 'g1g1'"
|
||||
class="col-md-7"
|
||||
>
|
||||
<h4 v-once> {{ $t('winterPromoGiftHeader') }} </h4>
|
||||
<p v-once> {{ $t('winterPromoGiftDetails1') }} </p>
|
||||
<p v-once> {{ $t('winterPromoGiftDetails2') }} </p>
|
||||
<h4 v-once>
|
||||
{{ $t('winterPromoGiftHeader') }}
|
||||
</h4>
|
||||
<p v-once>
|
||||
{{ $t('winterPromoGiftDetails1') }}
|
||||
</p>
|
||||
<p v-once>
|
||||
{{ $t('winterPromoGiftDetails2') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -309,15 +309,22 @@
|
||||
</div>
|
||||
<div
|
||||
v-if="currentEvent && currentEvent.promo && currentEvent.promo === 'g1g1'"
|
||||
class="m-5">
|
||||
class="m-5"
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
v-if="currentEvent && currentEvent.promo && currentEvent.promo === 'g1g1'"
|
||||
class="ml-5 mt-3"
|
||||
>
|
||||
<h2 v-once> {{ $t('winterPromoGiftHeader') }} </h2>
|
||||
<p v-once> {{ $t('winterPromoGiftDetails1') }} </p>
|
||||
<p v-once> {{ $t('winterPromoGiftDetails2') }} </p>
|
||||
<h2 v-once>
|
||||
{{ $t('winterPromoGiftHeader') }}
|
||||
</h2>
|
||||
<p v-once>
|
||||
{{ $t('winterPromoGiftDetails1') }}
|
||||
</p>
|
||||
<p v-once>
|
||||
{{ $t('winterPromoGiftDetails2') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -198,13 +198,13 @@ async function createSubscription (data) {
|
||||
// generate the message in both languages, so both users can understand it
|
||||
const languages = [data.user.preferences.language, data.gift.member.preferences.language];
|
||||
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,
|
||||
monthCount: shared.content.subscriptionBlocks[data.gift.subscription.key].months,
|
||||
}, languages[0]);
|
||||
|
||||
senderMsg = `\`${senderMsg}\``;
|
||||
data.user.sendMessage(data.gift.member, { senderMsg, save: false });
|
||||
receiverMsg = `\`${receiverMsg}\``;
|
||||
data.user.sendMessage(data.gift.member, { receiverMsg, save: false });
|
||||
} else {
|
||||
let senderMsg = shared.i18n.t('giftedSubscriptionFull', {
|
||||
username: data.gift.member.profile.name,
|
||||
|
||||
Reference in New Issue
Block a user