Fix some more Javascript linting issues and discrepancies with upstream (#2209)

* Fix typo in flavours/glitch/features/video/index.js

* Fix various linting issues and discrepancies with upstream
This commit is contained in:
Claire
2023-05-07 21:43:25 +02:00
committed by GitHub
parent ed0a407888
commit de74acbe0c
39 changed files with 87 additions and 200 deletions

View File

@ -8,9 +8,6 @@ import Overlay from 'react-overlays/Overlay';
import IconButton from 'flavours/glitch/components/icon_button';
import DropdownMenu from './dropdown_menu';
// Utils.
import { assignHandlers } from 'flavours/glitch/utils/react_helpers';
// The component.
export default class ComposerOptionsDropdown extends React.PureComponent {
@ -50,7 +47,7 @@ export default class ComposerOptionsDropdown extends React.PureComponent {
const { open } = this.state;
if (this.props.isUserTouching && this.props.isUserTouching()) {
if (this.state.open) {
if (open) {
this.props.onModalClose();
} else {
const modal = this.handleMakeModal();
@ -59,10 +56,10 @@ export default class ComposerOptionsDropdown extends React.PureComponent {
}
}
} else {
if (this.state.open && this.activeElement) {
if (open && this.activeElement) {
this.activeElement.focus({ preventScroll: true });
}
this.setState({ open: !this.state.open, openedViaKeyboard: type !== 'click' });
this.setState({ open: !open, openedViaKeyboard: type !== 'click' });
}
};