Fix redirecting to /publish
when compose form is visible in web UI (#19427)
This commit is contained in:
parent
3124f946ee
commit
5452af2188
2 changed files with 26 additions and 22 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue