From 37f4b8e8ed170f0ffccf73b6733dbe880ba80fd2 Mon Sep 17 00:00:00 2001 From: Ryan Tharp Date: Fri, 6 Dec 2019 14:12:10 -0800 Subject: [PATCH] use else --- .../conversation/UpdateGroupDialog.tsx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ts/components/conversation/UpdateGroupDialog.tsx b/ts/components/conversation/UpdateGroupDialog.tsx index 722950ea1..e89f0c479 100644 --- a/ts/components/conversation/UpdateGroupDialog.tsx +++ b/ts/components/conversation/UpdateGroupDialog.tsx @@ -89,23 +89,24 @@ export class UpdateGroupDialog extends React.Component { public render() { const checkMarkedCount = this.getMemberCount(this.state.friendList); - let titleText = `${this.props.titleText} (Members: ${checkMarkedCount})`; - const okText = this.props.okText; const cancelText = this.props.cancelText; - let noFriendsClasses = - this.state.friendList.length === 0 - ? 'no-friends' - : classNames('no-friends', 'hidden'); + let titleText; + let noFriendsClasses; - // alternatively, we can go back to const and use more trinary operators - // but this looks cleaner/more organized to me if (this.props.isPublic) { - // remove member count from title + // no member count in title titleText = `${this.props.titleText}`; // hide the no-friend message noFriendsClasses = classNames('no-friends', 'hidden'); + } else { + // private group + titleText = `${this.props.titleText} (Members: ${checkMarkedCount})`; + noFriendsClasses = + this.state.friendList.length === 0 + ? 'no-friends' + : classNames('no-friends', 'hidden'); } const errorMsg = this.state.errorMessage;