Merge pull request #520 from esteemapp/bugfix/#428

closed #428
This commit is contained in:
uğur erdal 2019-01-30 10:47:24 +03:00 committed by GitHub
commit 7db9049681

View File

@ -58,9 +58,11 @@ class PostDropdownContainer extends PureComponent {
case '0': case '0':
await writeToClipboard(getPostUrl(content.url)); await writeToClipboard(getPostUrl(content.url));
this.alertTimer = setTimeout(() => { this.alertTimer = setTimeout(() => {
Alert.alert(intl.formatMessage({ Alert.alert(
id: 'alert.copied', intl.formatMessage({
})); id: 'alert.copied',
}),
);
this.alertTimer = 0; this.alertTimer = 0;
}, 300); }, 300);
break; break;
@ -104,12 +106,12 @@ class PostDropdownContainer extends PureComponent {
const { currentAccount, content, intl } = this.props; const { currentAccount, content, intl } = this.props;
addBookmark(currentAccount.name, content.author, content.permlink) addBookmark(currentAccount.name, content.author, content.permlink)
.then(() => { .then(() => {
Alert.alert(intl.formatMessage({ id: 'bookmarks.added' })); Alert.alert(intl.formatMessage({ id: 'bookmarks.added' }));
}) })
.catch(() => { .catch(() => {
Alert.alert(intl.formatMessage({ id: 'alert.fail' })); Alert.alert(intl.formatMessage({ id: 'alert.fail' }));
}); });
} };
_reblog = () => { _reblog = () => {
const { const {
@ -163,12 +165,17 @@ class PostDropdownContainer extends PureComponent {
}; };
render() { render() {
const { intl } = this.props; const { intl, currentAccount, content } = this.props;
let _OPTIONS = OPTIONS;
if (content.author === currentAccount.name) {
_OPTIONS = OPTIONS.filter(item => item !== 'reblog');
}
return ( return (
<Fragment> <Fragment>
<PostDropdownView <PostDropdownView
options={OPTIONS.map(item => intl.formatMessage({ id: `post_dropdown.${item}` }).toUpperCase())} options={_OPTIONS.map(item => intl.formatMessage({ id: `post_dropdown.${item}` }).toUpperCase())}
handleOnDropdownSelect={this._handleOnDropdownSelect} handleOnDropdownSelect={this._handleOnDropdownSelect}
{...this.props} {...this.props}
/> />