0
0
Fork 0

Fix redirecting to /publish when compose form is visible in web UI (#19427)

This commit is contained in:
Eugen Rochko 2022-10-23 23:37:58 +02:00 committed by GitHub
parent 3124f946ee
commit 5452af2188
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 22 deletions

View file

@ -6,7 +6,7 @@ import ComposeFormContainer from 'mastodon/features/compose/containers/compose_f
import NavigationContainer from 'mastodon/features/compose/containers/navigation_container';
import LinkFooter from './link_footer';
import ServerBanner from 'mastodon/components/server_banner';
import { changeComposing } from 'mastodon/actions/compose';
import { changeComposing, mountCompose, unmountCompose } from 'mastodon/actions/compose';
export default @connect()
class ComposePanel extends React.PureComponent {
@ -20,11 +20,23 @@ class ComposePanel extends React.PureComponent {
};
onFocus = () => {
this.props.dispatch(changeComposing(true));
const { dispatch } = this.props;
dispatch(changeComposing(true));
}
onBlur = () => {
this.props.dispatch(changeComposing(false));
const { dispatch } = this.props;
dispatch(changeComposing(false));
}
componentDidMount () {
const { dispatch } = this.props;
dispatch(mountCompose());
}
componentWillUnmount () {
const { dispatch } = this.props;
dispatch(unmountCompose());
}
render() {