diff options
author | Aurélien Reeves <aurelien.reeves@hiptest.net> | 2019-05-09 22:39:27 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-05-09 22:39:26 +0200 |
commit | fe8a8f779e36e25286b6a7ddc7bcd08e2a4e2890 (patch) | |
tree | e8261bf0d49b2a8a589293bfd3d40b7983dad3ff /app/javascript/mastodon/containers/status_container.js | |
parent | f2be71c2931e0d0b8f1ec05f50bd7d791c420c91 (diff) |
Add confirm modal for unboosting toots (#10287)
[#3815] Display the boost modal also when unboosting toots.
Diffstat (limited to 'app/javascript/mastodon/containers/status_container.js')
-rw-r--r-- | app/javascript/mastodon/containers/status_container.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/javascript/mastodon/containers/status_container.js b/app/javascript/mastodon/containers/status_container.js index 0fce674e2..86324b846 100644 --- a/app/javascript/mastodon/containers/status_container.js +++ b/app/javascript/mastodon/containers/status_container.js @@ -69,18 +69,18 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ }, onModalReblog (status) { - dispatch(reblog(status)); + if (status.get('reblogged')) { + dispatch(unreblog(status)); + } else { + dispatch(reblog(status)); + } }, onReblog (status, e) { - if (status.get('reblogged')) { - dispatch(unreblog(status)); + if (e.shiftKey || !boostModal) { + this.onModalReblog(status); } else { - if (e.shiftKey || !boostModal) { - this.onModalReblog(status); - } else { - dispatch(openModal('BOOST', { status, onReblog: this.onModalReblog })); - } + dispatch(openModal('BOOST', { status, onReblog: this.onModalReblog })); } }, |