Skip to content

Commit

Permalink
fix: open own profile from comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Mineev committed Aug 8, 2021
1 parent 020b11d commit 8d1b6e0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions frontend/app/components/comment/comment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { COMMENT_NODE_CLASSNAME_PREFIX } from 'common/constants';
import { StaticStore } from 'common/static-store';
import { debounce } from 'utils/debounce';
import { copy } from 'common/copy';
import { Theme, BlockTTL, Comment as CommentType, PostInfo, User, CommentMode } from 'common/types';
import { Theme, BlockTTL, Comment as CommentType, PostInfo, User, CommentMode, Profile } from 'common/types';
import { extractErrorMessageFromResponse, FetcherError } from 'utils/errorUtils';
import { isUserAnonymous } from 'utils/isUserAnonymous';

Expand Down Expand Up @@ -144,7 +144,13 @@ export class Comment extends Component<CommentProps, State> {
};

toggleUserInfoVisibility = () => {
postMessageToParent({ profile: this.props.data.user });
const profile: Profile = { ...this.props.data.user };

if (this.props.user?.id === profile.id) {
profile.current = '1';
}

postMessageToParent({ profile });
};

togglePin = () => {
Expand Down

0 comments on commit 8d1b6e0

Please sign in to comment.