about summary refs log tree commit diff
path: root/app/javascript/mastodon/containers/status_container.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-09-23 23:00:12 +0200
committerGitHub <noreply@github.com>2022-09-23 23:00:12 +0200
commit0d6b878808a02aa4a544e894f06419c0f612c163 (patch)
tree119723ea46dd8525c370fee1235c3c9d42e55937 /app/javascript/mastodon/containers/status_container.js
parentd2f7e30a283a1dca1f7974884ac0c237b93903ad (diff)
Add user content translations with configurable backends (#19218)
Diffstat (limited to 'app/javascript/mastodon/containers/status_container.js')
-rw-r--r--app/javascript/mastodon/containers/status_container.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/javascript/mastodon/containers/status_container.js b/app/javascript/mastodon/containers/status_container.js
index 28698b082..9280a6ee3 100644
--- a/app/javascript/mastodon/containers/status_container.js
+++ b/app/javascript/mastodon/containers/status_container.js
@@ -25,6 +25,8 @@ import {
   revealStatus,
   toggleStatusCollapse,
   editStatus,
+  translateStatus,
+  undoStatusTranslation,
 } from '../actions/statuses';
 import {
   unmuteAccount,
@@ -150,6 +152,14 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({
     dispatch(editStatus(status.get('id'), history));
   },
 
+  onTranslate (status) {
+    if (status.get('translation')) {
+      dispatch(undoStatusTranslation(status.get('id')));
+    } else {
+      dispatch(translateStatus(status.get('id')));
+    }
+  },
+
   onDirect (account, router) {
     dispatch(directCompose(account, router));
   },