From 0caab5f80b330bf7aae1fdad6fa59571a67f258d Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Wed, 4 Sep 2019 10:41:14 +0300 Subject: [PATCH] Fixed auto comment oppening --- .../comments/container/commentsContainer.js | 47 ++++++++----------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/src/components/comments/container/commentsContainer.js b/src/components/comments/container/commentsContainer.js index c79c9d782..a4be6dbe7 100644 --- a/src/components/comments/container/commentsContainer.js +++ b/src/components/comments/container/commentsContainer.js @@ -198,33 +198,26 @@ class CommentsContainer extends Component { _handleOnPressCommentMenu = (index, selectedComment) => { const { dispatch, intl, navigation, isOwnProfile } = this.props; - switch (index) { - case 0: - writeToClipboard(`https://steemit.com${get(selectedComment, 'url')}`).then(() => { - dispatch( - toastNotification( - intl.formatMessage({ - id: 'alert.copied', - }), - ), - ); - }); - break; - case 1: - case isOwnProfile: - navigation.navigate({ - routeName: ROUTES.SCREENS.POST, - key: get(selectedComment, 'permlink'), - params: { - author: get(selectedComment, 'author'), - permlink: get(selectedComment, 'permlink'), - isHasParentPost: get(selectedComment, 'parent_permlink'), - }, - }); - break; - - default: - break; + if (index === 0) { + writeToClipboard(`https://steemit.com${get(selectedComment, 'url')}`).then(() => { + dispatch( + toastNotification( + intl.formatMessage({ + id: 'alert.copied', + }), + ), + ); + }); + } else if (index === 1 && isOwnProfile) { + navigation.navigate({ + routeName: ROUTES.SCREENS.POST, + key: get(selectedComment, 'permlink'), + params: { + author: get(selectedComment, 'author'), + permlink: get(selectedComment, 'permlink'), + isHasParentPost: get(selectedComment, 'parent_permlink'), + }, + }); } };