Merge pull request #1135 from esteemapp/bugfix/comment-open-thread

Fixed auto comment opening
This commit is contained in:
uğur erdal 2019-09-04 13:15:31 +03:00 committed by GitHub
commit 4c165856d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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'),
},
});
}
};