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

@@ -96,11 +96,16 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
},
onReblog (status, e) {
if (e.shiftKey || !boostModal) {
this.onModalReblog(status);
} else {
dispatch(openModal('BOOST', { status, onReblog: this.onModalReblog }));
}
dispatch((_, getState) => {
let state = getState();
if (state.getIn(['local_settings', 'confirm_boost_missing_media_description']) && status.get('media_attachments').some(item => !item.get('description')) && !status.get('reblogged')) {
dispatch(openModal('BOOST', { status, onReblog: this.handleModalReblog, missingMediaDescription: true }));
} else if (e.shiftKey || !boostModal) {
this.onModalReblog(status);
} else {
dispatch(openModal('BOOST', { status, onReblog: this.onModalReblog }));
}
});
},
onBookmark (status) {