From 8d1b6e0bd2e024c84bc4b08d151c6477f906e8ba Mon Sep 17 00:00:00 2001 From: Pavel Mineev Date: Sun, 8 Aug 2021 10:47:45 +0300 Subject: [PATCH] fix: open own profile from comment --- frontend/app/components/comment/comment.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/app/components/comment/comment.tsx b/frontend/app/components/comment/comment.tsx index 0600d0750d..e21da6a2f1 100644 --- a/frontend/app/components/comment/comment.tsx +++ b/frontend/app/components/comment/comment.tsx @@ -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'; @@ -144,7 +144,13 @@ export class Comment extends Component { }; 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 = () => {