about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/containers
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-04-11 19:42:25 +0200
committerThibaut Girka <thib@sitedethib.com>2018-04-11 21:05:34 +0200
commitacb434b0c998353e9e39379ecab27f68df41a100 (patch)
tree47bd8aeed4044bb42820aaada035630198f04391 /app/javascript/flavours/glitch/containers
parent09240810b4da0cdb8b98558985edfc522d3b9fb9 (diff)
Add glitch-soc front-end support for bookmarks
Unlike boosts and like, there is no confirmation dialog as misclicking
can be recovered without another user seeing it.
Diffstat (limited to 'app/javascript/flavours/glitch/containers')
-rw-r--r--app/javascript/flavours/glitch/containers/status_container.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/containers/status_container.js b/app/javascript/flavours/glitch/containers/status_container.js
index f3db05ae6..3fc6a6a79 100644
--- a/app/javascript/flavours/glitch/containers/status_container.js
+++ b/app/javascript/flavours/glitch/containers/status_container.js
@@ -9,8 +9,10 @@ import {
 import {
   reblog,
   favourite,
+  bookmark,
   unreblog,
   unfavourite,
+  unbookmark,
   pin,
   unpin,
 } from 'flavours/glitch/actions/interactions';
@@ -81,6 +83,14 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
     }
   },
 
+  onBookmark (status) {
+    if (status.get('bookmarked')) {
+      dispatch(unbookmark(status));
+    } else {
+      dispatch(bookmark(status));
+    }
+  },
+
   onModalFavourite (status) {
     dispatch(favourite(status));
   },