mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-01 19:50:37 +00:00
Make change regarding pluralization of gem gift message easier to read and not one long line
This commit is contained in:
parent
369386e370
commit
eaea55687b
1 changed files with 9 additions and 1 deletions
|
|
@ -38,7 +38,15 @@ api.sendMessage = function(user, member, data){
|
|||
msg = data.message
|
||||
} else {
|
||||
msg = "`Hello " + member.profile.name + ", " + user.profile.name + " has sent you ";
|
||||
msg += (data.type=='gems') ? data.gems.amount + " gem" + ((data.gems.amount>1)?"s":"") + "!`" : shared.content.subscriptionBlocks[data.subscription.key].months + " month" + ((shared.content.subscriptionBlocks[data.subscription.key].months>1)?"s":"") + " of subscription!`";
|
||||
if (data.type == 'gems') {
|
||||
var gemAmount = data.gems.amount;
|
||||
var gemLabel = gemAmount > 1 ? "gems" : "gem";
|
||||
msg += gemAmount + " " + gemLabel + "!`";
|
||||
} else {
|
||||
var monthAmount = shared.content.subscriptionBlocks[data.subscription.key].months;
|
||||
var monthLabel = monthAmount > 1 ? "months" : "month";
|
||||
msg += monthAmount + " " + monthLabel + " of subscription!`";
|
||||
}
|
||||
msg += data.message;
|
||||
}
|
||||
shared.refPush(member.inbox.messages, groups.chatDefaults(msg, user));
|
||||
|
|
|
|||
Loading…
Reference in a new issue