Skip to content

Commit

Permalink
PLT-7206: Remove the "Delete Channel" option for private channels if …
Browse files Browse the repository at this point in the history
…you're the last channel member and policy setting restricts channel deletion (mattermost#7314)

* Removed restriction that prevented last occupant of a channel from leaving. Any user can now leave any channel, except for the default Town Square channel

* Also removed last user leave limitation from navbar
  • Loading branch information
MusikPolice committed Aug 30, 2017
1 parent a76f78a commit 0fbcde8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions components/channel_header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -680,8 +680,7 @@ export default class ChannelHeader extends React.Component {
);
}

const canLeave = channel.type === Constants.PRIVATE_CHANNEL ? this.state.userCount > 1 : true;
if (!ChannelStore.isDefault(channel) && canLeave) {
if (!ChannelStore.isDefault(channel)) {
dropdownContents.push(
<li
key='divider-3'
Expand Down
3 changes: 1 addition & 2 deletions components/navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,7 @@ export default class Navbar extends React.Component {
);
}

const canLeave = channel.type === Constants.PRIVATE_CHANNEL ? this.state.userCount > 1 : true;
if (!ChannelStore.isDefault(channel) && canLeave) {
if (!ChannelStore.isDefault(channel)) {
leaveChannelOption = (
<li role='presentation'>
<a
Expand Down

0 comments on commit 0fbcde8

Please sign in to comment.