Skip to content

Commit

Permalink
Avoid deleting anonymous user
Browse files Browse the repository at this point in the history
  • Loading branch information
javierbrea committed Feb 26, 2019
1 parent 649a6aa commit d378eeb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/user/User.js
Expand Up @@ -318,7 +318,7 @@ export class User extends Component {
const submitEnabled = this.submitEnabled();

const deleteButton =
user._id && user.role !== "anonymous" && currentUserIsAdmin ? (
user._id && !user.isAnonymous && currentUserIsAdmin ? (
<Button
color="red"
loading={userDeleteLoading}
Expand Down
3 changes: 2 additions & 1 deletion src/data-layer/users/user/selectors.js
Expand Up @@ -24,7 +24,8 @@ export const userModelsWithExtraData = new Selector(
return {
...userResults,
...avatarResult,
isSystemRole: isSystemRole(userResults, rolesResults)
isSystemRole: isSystemRole(userResults, rolesResults),
isAnonymous: userResults.role === "anonymous"
};
},
{}
Expand Down

0 comments on commit d378eeb

Please sign in to comment.