FIX: composer education message for group mentions were broken (#14937)

Composer education message for group mentions were broken because the
count parameter is a string instead of a number.
This commit is contained in:
Arpit Jalan 2021-11-15 17:12:06 +05:30 committed by GitHub
parent fc3a6e57e3
commit 8c4896f660
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -675,17 +675,19 @@ export default Controller.extend({
groups.forEach((group) => { groups.forEach((group) => {
let body; let body;
const groupLink = getURL(`/g/${group.name}/members`); const groupLink = getURL(`/g/${group.name}/members`);
const maxMentions = parseInt(group.max_mentions, 10);
const userCount = parseInt(group.user_count, 10);
if (group.max_mentions < group.user_count) { if (maxMentions < userCount) {
body = I18n.t("composer.group_mentioned_limit", { body = I18n.t("composer.group_mentioned_limit", {
group: `@${group.name}`, group: `@${group.name}`,
count: group.max_mentions, count: maxMentions,
group_link: groupLink, group_link: groupLink,
}); });
} else if (group.user_count > 0) { } else if (group.user_count > 0) {
body = I18n.t("composer.group_mentioned", { body = I18n.t("composer.group_mentioned", {
group: `@${group.name}`, group: `@${group.name}`,
count: group.user_count, count: userCount,
group_link: groupLink, group_link: groupLink,
}); });
} }