about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/status/index.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-06-07 18:38:07 +0200
committerThibG <thib@sitedethib.com>2019-06-10 16:24:09 +0200
commitccfb48d3eb354e5cdce24dc975ea8a3fb2a1c80e (patch)
tree4a17c968d682981d7d661ade73b82a9bb78077db /app/javascript/flavours/glitch/features/status/index.js
parentd61a6271c68ecca1745f2683d25ec58573dd2819 (diff)
Add option to display a warning before boosting toots lacking media descriptions
Diffstat (limited to 'app/javascript/flavours/glitch/features/status/index.js')
-rw-r--r--app/javascript/flavours/glitch/features/status/index.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/javascript/flavours/glitch/features/status/index.js b/app/javascript/flavours/glitch/features/status/index.js
index 145a33fff..8722490d9 100644
--- a/app/javascript/flavours/glitch/features/status/index.js
+++ b/app/javascript/flavours/glitch/features/status/index.js
@@ -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 }));
       }
     }
   }