From eb80022991ef793253c34e25600948d91b26ea47 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 23 Jun 2018 16:40:27 +0100 Subject: [PATCH] focus composer after interacting with e2ee statusbar/udd Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/RoomStatusBar.js | 3 +++ src/cryptodevices.js | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/components/structures/RoomStatusBar.js b/src/components/structures/RoomStatusBar.js index 8034923158..36f4719abb 100644 --- a/src/components/structures/RoomStatusBar.js +++ b/src/components/structures/RoomStatusBar.js @@ -25,6 +25,7 @@ import MatrixClientPeg from '../../MatrixClientPeg'; import MemberAvatar from '../views/avatars/MemberAvatar'; import Resend from '../../Resend'; import * as cryptodevices from '../../cryptodevices'; +import dis from '../../dispatcher'; const STATUS_BAR_HIDDEN = 0; const STATUS_BAR_EXPANDED = 1; @@ -157,10 +158,12 @@ module.exports = React.createClass({ _onResendAllClick: function() { Resend.resendUnsentEvents(this.props.room); + dis.dispatch({action: 'focus_composer'}); }, _onCancelAllClick: function() { Resend.cancelUnsentEvents(this.props.room); + dis.dispatch({action: 'focus_composer'}); }, _onShowDevicesClick: function() { diff --git a/src/cryptodevices.js b/src/cryptodevices.js index c0b7e3da6e..d11aa47cda 100644 --- a/src/cryptodevices.js +++ b/src/cryptodevices.js @@ -16,6 +16,7 @@ limitations under the License. import Resend from './Resend'; import sdk from './index'; +import dis from './dispatcher'; import Modal from './Modal'; import { _t } from './languageHandler'; @@ -65,6 +66,10 @@ export function getUnknownDevicesForRoom(matrixClient, room) { }); } +function focusComposer() { + dis.dispatch({action: 'focus_composer'}); +} + /** * Show the UnknownDeviceDialog for a given room. The dialog will inform the user * that messages they sent to this room have not been sent due to unknown devices @@ -86,6 +91,7 @@ export function showUnknownDeviceDialogForMessages(matrixClient, room) { sendAnywayLabel: _t("Send anyway"), sendLabel: _t("Send"), onSend: onSendClicked, + onFinished: focusComposer, }, 'mx_Dialog_unknownDevice'); }); }