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

This commit is contained in:
Thibaut Girka authored and ThibG committed 2019-06-10 16:24:09 +02:00
1 parent d61a6271c6
commit ccfb48d3eb
5 files changed
+35 -10

No files matched your search

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