Skip to content

Commit

Permalink
show post's menu to post's non-creator
Browse files Browse the repository at this point in the history
  • Loading branch information
tima101 committed Jul 23, 2020
1 parent 1380898 commit 55c9b0b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/components/posts/PostDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class PostDetail extends React.Component<{
const { post, store } = this.props;
const { currentUser } = store;

if (!post.user || !currentUser || currentUser._id !== post.user._id) {
if (!post.user || !currentUser) {
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion book/8-end/app/components/posts/PostDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class PostDetail extends React.Component<Props> {
const { post, store } = this.props;
const { currentUser } = store;

if (!post.user || !currentUser || currentUser._id !== post.user._id) {
if (!post.user || !currentUser) {
return null;
}

Expand Down
4 changes: 2 additions & 2 deletions book/8-end/app/components/posts/PostForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class PostForm extends React.Component<Props, State> {
}

return {
content: (post && post.content) || '',
postId: (post && post._id) || null,
content: (post && post.content) || '',
};
}

Expand All @@ -68,7 +68,7 @@ class PostForm extends React.Component<Props, State> {
<div style={{ height: '100%', margin: '0px 20px' }}>
<p />
<br />
<h3>{title} </h3>
<h3>{title}</h3>
<form style={{ width: '100%', height: '100%' }} onSubmit={this.onSubmit} autoComplete="off">
<p />
<br />
Expand Down

0 comments on commit 55c9b0b

Please sign in to comment.