mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-07 18:31:07 +00:00
Make translate undo work
This commit is contained in:
parent
5e50840986
commit
6c38ab5b6b
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user