From 1a5bed5a105f1db0bd219e52983fb03ff65ad704 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 31 Jan 2020 17:16:27 +0100 Subject: [PATCH] open a to_device request in a modal instead of the right panel 1st room --- .../views/toasts/VerificationRequestToast.js | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/views/toasts/VerificationRequestToast.js b/src/components/views/toasts/VerificationRequestToast.js index a5a26f7ddb..92402c3f98 100644 --- a/src/components/views/toasts/VerificationRequestToast.js +++ b/src/components/views/toasts/VerificationRequestToast.js @@ -78,28 +78,28 @@ export default class VerificationRequestToast extends React.PureComponent { // no room id for to_device requests const cli = MatrixClientPeg.get(); try { + await request.accept(); if (request.channel.roomId) { dis.dispatch({ action: 'view_room', room_id: request.channel.roomId, should_peek: false, }); - } else { dis.dispatch({ - action: 'view_room', - room_id: cli.getRooms()[0].roomId, - should_peek: false, + action: "set_right_panel_phase", + phase: RIGHT_PANEL_PHASES.EncryptionPanel, + refireParams: { + verificationRequest: request, + member: cli.getUser(request.otherUserId), + }, }); - } - await request.accept(); - dis.dispatch({ - action: "set_right_panel_phase", - phase: RIGHT_PANEL_PHASES.EncryptionPanel, - refireParams: { + } else { + const VerificationRequestDialog = sdk.getComponent("views.dialogs.VerificationRequestDialog"); + Modal.createTrackedDialog('Incoming Verification', '', VerificationRequestDialog, { verificationRequest: request, - member: cli.getUser(request.otherUserId), - }, - }); + }, null, /* priority = */ false, /* static = */ true); + } + // } else if (request.channel.deviceId && request.verifier) { // // show to_device verifications in dialog still // const IncomingSasDialog = sdk.getComponent("views.dialogs.IncomingSasDialog");