Fix switching to DMs from more DM list (#4494)

Этот коммит содержится в:
Joram Wilander
2016-11-08 09:58:17 -05:00
коммит произвёл Harrison Healey
родитель a6526aa03d
Коммит 40e8fbaa62

Просмотреть файл

@@ -39,6 +39,7 @@ export default class MoreDirectChannels extends React.Component {
users: null, users: null,
loadingDMChannel: -1, loadingDMChannel: -1,
listType: 'team', listType: 'team',
show: true,
search: false search: false
}; };
} }
@@ -61,15 +62,17 @@ export default class MoreDirectChannels extends React.Component {
} }
handleHide() { handleHide() {
if (this.props.onModalDismissed) { this.setState({show: false});
this.props.onModalDismissed();
}
} }
handleExit() { handleExit() {
if (this.exitToDirectChannel) { if (this.exitToDirectChannel) {
browserHistory.push(this.exitToDirectChannel); browserHistory.push(this.exitToDirectChannel);
} }
if (this.props.onModalDismissed) {
this.props.onModalDismissed();
}
} }
handleShowDirectChannel(teammate, e) { handleShowDirectChannel(teammate, e) {
@@ -226,7 +229,7 @@ export default class MoreDirectChannels extends React.Component {
return ( return (
<Modal <Modal
dialogClassName='more-modal more-direct-channels' dialogClassName='more-modal more-direct-channels'
show={this.props.show} show={this.state.show}
onHide={this.handleHide} onHide={this.handleHide}
onExited={this.handleExit} onExited={this.handleExit}
> >
@@ -269,6 +272,5 @@ export default class MoreDirectChannels extends React.Component {
} }
MoreDirectChannels.propTypes = { MoreDirectChannels.propTypes = {
show: React.PropTypes.bool.isRequired,
onModalDismissed: React.PropTypes.func onModalDismissed: React.PropTypes.func
}; };