diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-06-07 18:38:07 +0200 |
---|---|---|
committer | ThibG <thib@sitedethib.com> | 2019-06-10 16:24:09 +0200 |
commit | ccfb48d3eb354e5cdce24dc975ea8a3fb2a1c80e (patch) | |
tree | 4a17c968d682981d7d661ade73b82a9bb78077db /app/javascript/flavours/glitch/containers | |
parent | d61a6271c68ecca1745f2683d25ec58573dd2819 (diff) |
Add option to display a warning before boosting toots lacking media descriptions
Diffstat (limited to 'app/javascript/flavours/glitch/containers')
-rw-r--r-- | app/javascript/flavours/glitch/containers/status_container.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/app/javascript/flavours/glitch/containers/status_container.js b/app/javascript/flavours/glitch/containers/status_container.js index 98dc5bb87..a6069cb90 100644 --- a/app/javascript/flavours/glitch/containers/status_container.js +++ b/app/javascript/flavours/glitch/containers/status_container.js @@ -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) { |