Add option to display a warning before boosting toots lacking media descriptions

This commit is contained in:
Thibaut Girka
2019-06-07 18:38:07 +02:00
committed by ThibG
parent d61a6271c6
commit ccfb48d3eb
5 changed files with 35 additions and 10 deletions

View File

@ -235,13 +235,17 @@ export default class Status extends ImmutablePureComponent {
}
handleReblogClick = (status, e) => {
const { settings, dispatch } = this.props;
if (status.get('reblogged')) {
this.props.dispatch(unreblog(status));
dispatch(unreblog(status));
} else {
if ((e && e.shiftKey) || !boostModal) {
if (settings.get('confirm_boost_missing_media_description') && status.get('media_attachments').some(item => !item.get('description'))) {
dispatch(openModal('BOOST', { status, onReblog: this.handleModalReblog, missingMediaDescription: true }));
} else if ((e && e.shiftKey) || !boostModal) {
this.handleModalReblog(status);
} else {
this.props.dispatch(openModal('BOOST', { status, onReblog: this.handleModalReblog }));
dispatch(openModal('BOOST', { status, onReblog: this.handleModalReblog }));
}
}
}