From f71ac939463eb28e0cd264695711fb9f64fbe1cd Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 10 Nov 2016 15:38:20 +0000 Subject: [PATCH] Prefer null to falsy, use correct plural --- src/components/views/elements/MemberEventListSummary.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/views/elements/MemberEventListSummary.js b/src/components/views/elements/MemberEventListSummary.js index 0ecdecb4ee..109dd0e740 100644 --- a/src/components/views/elements/MemberEventListSummary.js +++ b/src/components/views/elements/MemberEventListSummary.js @@ -103,7 +103,7 @@ module.exports = React.createClass({ ); } - let leaveSummary = ''; + let leaveSummary = null; if (leavers) { leaveSummary = ( @@ -186,7 +186,8 @@ module.exports = React.createClass({ toggleButton = ( {expanded?'collapse':'expand'} ); - let noun = (joinAndLeft === 1 ? 'user' : 'others'); + let plural = (joinEvents.length + leaveEvents.length > 0) ? 'others' : 'users'; + let noun = (joinAndLeft === 1 ? 'user' : plural); summaryContainer = (