frequentlyUsedLanguages
not updated correctly (#31386)
This commit is contained in:
parent
19849eb91d
commit
8adf67f2db
4 changed files with 2 additions and 24 deletions
|
@ -240,7 +240,6 @@ class LanguageDropdown extends PureComponent {
|
|||
frequentlyUsedLanguages: PropTypes.arrayOf(PropTypes.string),
|
||||
intl: PropTypes.object.isRequired,
|
||||
onChange: PropTypes.func,
|
||||
onClose: PropTypes.func,
|
||||
};
|
||||
|
||||
state = {
|
||||
|
@ -257,14 +256,11 @@ class LanguageDropdown extends PureComponent {
|
|||
};
|
||||
|
||||
handleClose = () => {
|
||||
const { value, onClose } = this.props;
|
||||
|
||||
if (this.state.open && this.activeElement) {
|
||||
this.activeElement.focus({ preventScroll: true });
|
||||
}
|
||||
|
||||
this.setState({ open: false });
|
||||
onClose(value);
|
||||
};
|
||||
|
||||
handleChange = value => {
|
||||
|
|
|
@ -4,7 +4,6 @@ import { connect } from 'react-redux';
|
|||
|
||||
|
||||
import { changeComposeLanguage } from 'mastodon/actions/compose';
|
||||
import { useLanguage } from 'mastodon/actions/languages';
|
||||
|
||||
import LanguageDropdown from '../components/language_dropdown';
|
||||
|
||||
|
@ -28,11 +27,6 @@ const mapDispatchToProps = dispatch => ({
|
|||
dispatch(changeComposeLanguage(value));
|
||||
},
|
||||
|
||||
onClose (value) {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks -- this is not a react hook
|
||||
dispatch(useLanguage(value));
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(LanguageDropdown);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue