From 35620311b338a1f66325ca686bad0809f71a2807 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 13 Jun 2017 10:15:29 +0100 Subject: [PATCH] Fix regressions with starting a 1-1. --- src/components/views/dialogs/ChatInviteDialog.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/views/dialogs/ChatInviteDialog.js b/src/components/views/dialogs/ChatInviteDialog.js index 2f635fd670..e331432228 100644 --- a/src/components/views/dialogs/ChatInviteDialog.js +++ b/src/components/views/dialogs/ChatInviteDialog.js @@ -24,6 +24,7 @@ import DMRoomMap from '../../../utils/DMRoomMap'; import Modal from '../../../Modal'; import AccessibleButton from '../elements/AccessibleButton'; import q from 'q'; +import dis from '../../../dispatcher'; const TRUNCATE_QUERY_LIST = 40; const QUERY_USER_DIRECTORY_DEBOUNCE_MS = 200; @@ -102,7 +103,7 @@ module.exports = React.createClass({ const ChatCreateOrReuseDialog = sdk.getComponent( "views.dialogs.ChatCreateOrReuseDialog", ); - Modal.createDialog(ChatCreateOrReuseDialog, { + const close = Modal.createDialog(ChatCreateOrReuseDialog, { userId: userId, onFinished: (success) => { this.props.onFinished(success); @@ -112,14 +113,16 @@ module.exports = React.createClass({ action: 'start_chat', user_id: userId, }); + close(true); }, onExistingRoomSelected: (roomId) => { dis.dispatch({ action: 'view_room', - user_id: roomId, + room_id: roomId, }); + close(true); }, - }); + }).close; } else { this._startChat(inviteList); }