From 45b22f312d3f57c63f86ffdbbb50c29108099993 Mon Sep 17 00:00:00 2001 From: enahum Date: Tue, 10 May 2016 09:24:52 -0300 Subject: PLT-2674 Private Group should not have Leave option when only one member remains (#2888) --- webapp/components/channel_header.jsx | 3 ++- webapp/components/navbar.jsx | 31 +++++++++++++++++-------------- 2 files changed, 19 insertions(+), 15 deletions(-) (limited to 'webapp') diff --git a/webapp/components/channel_header.jsx b/webapp/components/channel_header.jsx index 992244915..ca3878d68 100644 --- a/webapp/components/channel_header.jsx +++ b/webapp/components/channel_header.jsx @@ -409,7 +409,8 @@ export default class ChannelHeader extends React.Component { } } - if (!ChannelStore.isDefault(channel)) { + const canLeave = channel.type === Constants.PRIVATE_CHANNEL ? this.state.userCount > 1 : true; + if (!ChannelStore.isDefault(channel) && canLeave) { dropdownContents.push(
  • ); - leaveChannelOption = ( -
  • - - - -
  • - ); + const canLeave = channel.type === Constants.PRIVATE_CHANNEL ? this.state.userCount > 1 : true; + if (canLeave) { + leaveChannelOption = ( +
  • + + + +
  • + ); + } } var manageMembersOption; -- cgit v1.2.3-1-g7c22