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

This commit is contained in:
Eugen Rochko authored and GitHub committed 2022-10-23 23:37:58 +02:00
1 parent 3124f946ee
commit 5452af2188
2 files changed
+26 -22

No files matched your search

@@ -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() {