Do not push DMs into the home feed (#8940)

* Do not push DMs into the home feed

* Show DMs column after sending a DM, if DMs column is not already shown
This commit is contained in:
Eugen Rochko
2018-10-11 01:31:03 +02:00
committed by GitHub
parent 790d3bc637
commit 87fdd139b8
11 changed files with 52 additions and 64 deletions

View File

@@ -30,6 +30,10 @@ const messages = defineMessages({
export default @injectIntl
class ComposeForm extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = {
intl: PropTypes.object.isRequired,
text: PropTypes.string.isRequired,
@@ -84,7 +88,7 @@ class ComposeForm extends ImmutablePureComponent {
return;
}
this.props.onSubmit();
this.props.onSubmit(this.context.router.history);
}
onSuggestionsClearRequested = () => {

View File

@@ -14,6 +14,10 @@ const messages = defineMessages({
export default @injectIntl
class Upload extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,
};
static propTypes = {
media: ImmutablePropTypes.map.isRequired,
intl: PropTypes.object.isRequired,
@@ -37,7 +41,7 @@ class Upload extends ImmutablePureComponent {
handleSubmit = () => {
this.handleInputBlur();
this.props.onSubmit();
this.props.onSubmit(this.context.router.history);
}
handleUndoClick = () => {

View File

@@ -33,8 +33,8 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(changeCompose(text));
},
onSubmit () {
dispatch(submitCompose());
onSubmit (router) {
dispatch(submitCompose(router));
},
onClearSuggestions () {

View File

@@ -22,8 +22,8 @@ const mapDispatchToProps = dispatch => ({
dispatch(openModal('FOCAL_POINT', { id }));
},
onSubmit () {
dispatch(submitCompose());
onSubmit (router) {
dispatch(submitCompose(router));
},
});

View File

@@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import Column from '../../components/column';
import ColumnHeader from '../../components/column_header';
import { expandConversations } from '../../actions/conversations';
import { mountConversations, unmountConversations, expandConversations } from '../../actions/conversations';
import { addColumn, removeColumn, moveColumn } from '../../actions/columns';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { connectDirectStream } from '../../actions/streaming';
@@ -48,11 +48,14 @@ class DirectTimeline extends React.PureComponent {
componentDidMount () {
const { dispatch } = this.props;
dispatch(mountConversations());
dispatch(expandConversations());
this.disconnect = dispatch(connectDirectStream());
}
componentWillUnmount () {
this.props.dispatch(unmountConversations());
if (this.disconnect) {
this.disconnect();
this.disconnect = null;