preselectOnReply: PropTypes.bool,
onChangeSpoilerness: PropTypes.func,
onChangeVisibility: PropTypes.func,
- onMount: PropTypes.func,
- onUnmount: PropTypes.func,
onPaste: PropTypes.func,
onMediaDescriptionConfirm: PropTypes.func,
};
}
}
- // Tells our state the composer has been mounted.
- componentDidMount () {
- const { onMount } = this.props;
- if (onMount) {
- onMount();
- }
- }
-
- // Tells our state the composer has been unmounted.
- componentWillUnmount () {
- const { onUnmount } = this.props;
- if (onUnmount) {
- onUnmount();
- }
- }
-
handleFocus = () => {
if (this.composeForm) {
this.composeForm.scrollIntoView();
clearComposeSuggestions,
fetchComposeSuggestions,
insertEmojiCompose,
- mountCompose,
selectComposeSuggestion,
submitCompose,
- unmountCompose,
uploadCompose,
} from 'flavours/glitch/actions/compose';
import {
dispatch(changeComposeVisibility(value));
},
- onMount() {
- dispatch(mountCompose());
- },
-
- onUnmount() {
- dispatch(unmountCompose());
- },
-
onMediaDescriptionConfirm(routerHistory) {
dispatch(openModal('CONFIRM', {
message: intl.formatMessage(messages.missingDescriptionMessage),
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
+import { mountCompose, unmountCompose } from 'flavours/glitch/actions/compose';
import { injectIntl, defineMessages } from 'react-intl';
import classNames from 'classnames';
import SearchContainer from './containers/search_container';
onClickElefriend () {
dispatch(cycleElefriendCompose());
},
+
+ onMount () {
+ dispatch(mountCompose());
+ },
+
+ onUnmount () {
+ dispatch(unmountCompose());
+ },
});
export default @connect(mapStateToProps, mapDispatchToProps)
isSearchPage: PropTypes.bool,
elefriend: PropTypes.number,
onClickElefriend: PropTypes.func,
+ onMount: PropTypes.func,
+ onUnmount: PropTypes.func,
intl: PropTypes.object.isRequired,
};
+ componentDidMount () {
+ const { isSearchPage } = this.props;
+
+ if (!isSearchPage) {
+ this.props.onMount();
+ }
+ }
+
+ componentWillUnmount () {
+ const { isSearchPage } = this.props;
+
+ if (!isSearchPage) {
+ this.props.onUnmount();
+ }
+ }
+
render () {
const {
elefriend,