about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/containers
diff options
context:
space:
mode:
authorcwm <chriswmartin@protonmail.com>2017-12-09 10:26:22 -0600
committercwm <chriswmartin@protonmail.com>2017-12-09 10:26:22 -0600
commitabe95b614b6355e61dd2955e09115ac473417c84 (patch)
tree77c7be825dd75ea4afe78c0d7cfe054592c92d05 /app/javascript/flavours/glitch/containers
parent776867ea73f2fb9180a90b09cd98d801ca2aeef0 (diff)
add initial components based off of tootsuite pr #1507
Diffstat (limited to 'app/javascript/flavours/glitch/containers')
-rw-r--r--app/javascript/flavours/glitch/containers/status_container.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/app/javascript/flavours/glitch/containers/status_container.js b/app/javascript/flavours/glitch/containers/status_container.js
index b753de7b3..8bf33c70f 100644
--- a/app/javascript/flavours/glitch/containers/status_container.js
+++ b/app/javascript/flavours/glitch/containers/status_container.js
@@ -20,7 +20,7 @@ import { initMuteModal } from 'flavours/glitch/actions/mutes';
 import { initReport } from 'flavours/glitch/actions/reports';
 import { openModal } from 'flavours/glitch/actions/modal';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
-import { boostModal, deleteModal } from 'flavours/glitch/util/initial_state';
+import { boostModal, favouriteModal, deleteModal } from 'flavours/glitch/util/initial_state';
 
 const messages = defineMessages({
   deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },
@@ -78,14 +78,22 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
     }
   },
 
-  onFavourite (status) {
+  onModalFavourite (status) {
+    dispatch(favourite(status));
+  },
+
+  onFavourite (status, e) {
     if (status.get('favourited')) {
       dispatch(unfavourite(status));
     } else {
-      dispatch(favourite(status));
+      if (e.shiftKey || !favouriteModal) {
+        this.onModalFavourite(status);
+      } else {
+        dispatch(openModal('FAVOURITE', { status, onFavourite: this.onModalFavourite }));
+      }
     }
   },
-
+  
   onPin (status) {
     if (status.get('pinned')) {
       dispatch(unpin(status));