diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-04-11 19:42:25 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2018-04-11 21:05:34 +0200 |
commit | acb434b0c998353e9e39379ecab27f68df41a100 (patch) | |
tree | 47bd8aeed4044bb42820aaada035630198f04391 /app/javascript/flavours/glitch/containers | |
parent | 09240810b4da0cdb8b98558985edfc522d3b9fb9 (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.js | 10 |
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)); }, |