From 6c38ab5b6b1455f2284e34618cd7d8ef7130d27f Mon Sep 17 00:00:00 2001 From: Thomas Steiner Date: Sun, 22 Jun 2025 13:14:45 +0200 Subject: [PATCH] Make translate undo work --- app/javascript/mastodon/components/status_content.jsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/javascript/mastodon/components/status_content.jsx b/app/javascript/mastodon/components/status_content.jsx index 9c886008056..b58613d9698 100644 --- a/app/javascript/mastodon/components/status_content.jsx +++ b/app/javascript/mastodon/components/status_content.jsx @@ -11,6 +11,7 @@ import { connect } from 'react-redux'; import ChevronRightIcon from '@/material-icons/400-24px/chevron_right.svg?react'; import { translateStatusSuccess } from 'mastodon/actions/statuses'; +import { undoStatusTranslation } from 'mastodon/actions/statuses'; import { Icon } from 'mastodon/components/icon'; import { Poll } from 'mastodon/components/poll'; import { identityContextPropShape, withIdentity } from 'mastodon/identity_context'; @@ -223,6 +224,12 @@ class StatusContent extends PureComponent { } const { intl, status, statusContent } = this.props; + + if (status.get('translation')) { + this.props.dispatch(undoStatusTranslation(status.get('id'), status.get('poll'))); + return; + } + const sourceLanguage = status.get('language'); const targetLanguage = intl.locale.replace(/[_-].*/, ''); try {