You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-05 23:10:41 +03:00
Factor out showing UnknownDeviceDialog
So we can re-use it for calls that fail due to unknwon devices
This commit is contained in:
@@ -23,8 +23,7 @@ import WhoIsTyping from '../../WhoIsTyping';
|
||||
import MatrixClientPeg from '../../MatrixClientPeg';
|
||||
import MemberAvatar from '../views/avatars/MemberAvatar';
|
||||
import Resend from '../../Resend';
|
||||
import Modal from '../../Modal';
|
||||
import { getUnknownDevicesForRoom } from '../../cryptodevices';
|
||||
import { getUnknownDevicesForRoom, showUnknownDeviceDialogForMessages } from '../../cryptodevices';
|
||||
|
||||
const HIDE_DEBOUNCE_MS = 10000;
|
||||
const STATUS_BAR_HIDDEN = 0;
|
||||
@@ -158,15 +157,7 @@ module.exports = React.createClass({
|
||||
},
|
||||
|
||||
_onShowDevicesClick: function() {
|
||||
getUnknownDevicesForRoom(MatrixClientPeg.get(), this.props.room).then((unknownDevices) => {
|
||||
if (this._unmounted) return;
|
||||
|
||||
const UnknownDeviceDialog = sdk.getComponent('dialogs.UnknownDeviceDialog');
|
||||
Modal.createTrackedDialog('Unknown Device Dialog', '', UnknownDeviceDialog, {
|
||||
room: this.props.room,
|
||||
devices: unknownDevices,
|
||||
}, 'mx_Dialog_unknownDevice');
|
||||
});
|
||||
showUnknownDeviceDialogForMessages(MatrixClientPeg.get(), this.props.room);
|
||||
},
|
||||
|
||||
onRoomLocalEchoUpdated: function(event, room, oldEventId, oldStatus) {
|
||||
@@ -414,7 +405,6 @@ module.exports = React.createClass({
|
||||
return null;
|
||||
},
|
||||
|
||||
|
||||
render: function() {
|
||||
const content = this._getContent();
|
||||
const indicator = this._getIndicator(this.state.usersTyping.length > 0);
|
||||
|
||||
Reference in New Issue
Block a user