Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Fix UDD for voip in e2e rooms
Browse files Browse the repository at this point in the history
When starting a call, several events are sent and if some devices are unverified, all three will trigger their own UnknownDeviceError. This causes three overlapping, identical UnknownDeviceDialogs.

This change effectively dedupes the dialogs so that only one is shown. This is safe to do because the UDD allows resending of _all_ events that were left unsent.

Fixes element-hq/element-web#3285
  • Loading branch information
Luke Barnard committed Mar 16, 2017
1 parent f51a022 commit 3ce0da4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/UnknownDeviceErrorHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ import dis from './dispatcher';
import sdk from './index';
import Modal from './Modal';

let isDialogOpen = false;

const onAction = function(payload) {
if (payload.action === 'unknown_device_error') {
if (payload.action === 'unknown_device_error' && !isDialogOpen) {
var UnknownDeviceDialog = sdk.getComponent("dialogs.UnknownDeviceDialog");
isDialogOpen = true;
Modal.createDialog(UnknownDeviceDialog, {
devices: payload.err.devices,
room: payload.room,
onFinished: (r) => {
isDialogOpen = false;
// XXX: temporary logging to try to diagnose
// https://github.com/vector-im/riot-web/issues/3148
console.log('UnknownDeviceDialog closed with '+r);
Expand Down

0 comments on commit 3ce0da4

Please sign in to comment.