Factor out showing UnknownDeviceDialog
So we can re-use it for calls that fail due to unknwon devices
This commit is contained in:
parent
f8fc6dc83e
commit
93800be742
3 changed files with 46 additions and 35 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue