clearComposeSuggestions,
fetchComposeSuggestions,
insertEmojiCompose,
+ mountCompose,
selectComposeSuggestion,
submitCompose,
toggleComposeAdvancedOption,
undoUploadCompose,
+ unmountCompose,
uploadCompose,
} from 'flavours/glitch/actions/compose';
import {
onCloseModal: closeModal,
onFetchSuggestions: fetchComposeSuggestions,
onInsertEmoji: insertEmojiCompose,
+ onMount: mountCompose,
onOpenActionsModal: openModal.bind(null, 'ACTIONS'),
onOpenDoodleModal: openModal.bind(null, 'DOODLE', { noEsc: true }),
onSelectSuggestion: selectComposeSuggestion,
onSubmit: submitCompose,
onToggleAdvancedOption: toggleComposeAdvancedOption,
onUndoUpload: undoUploadCompose,
+ onUnmount: unmountCompose,
onUpload: uploadCompose,
};
}
}
+ // 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();
+ }
+ }
+
// This statement does several things:
// - If we're beginning a reply, and,
// - Replying to zero or one users, places the cursor at the end
onCloseModal: PropTypes.func,
onFetchSuggestions: PropTypes.func,
onInsertEmoji: PropTypes.func,
+ onMount: PropTypes.func,
onOpenActionsModal: PropTypes.func,
onOpenDoodleModal: PropTypes.func,
onSelectSuggestion: PropTypes.func,
onSubmit: PropTypes.func,
onToggleAdvancedOption: PropTypes.func,
onUndoUpload: PropTypes.func,
+ onUnmount: PropTypes.func,
onUpload: PropTypes.func,
};