From 93aebf9e68ce304497c81cca9a371b9e2630dbe7 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 9 Oct 2019 11:30:44 +0100 Subject: [PATCH] Return promises a better way --- src/AddThreepid.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/AddThreepid.js b/src/AddThreepid.js index f4a2a88b36..548ed4ce48 100644 --- a/src/AddThreepid.js +++ b/src/AddThreepid.js @@ -188,12 +188,13 @@ export default class AddThreepid { // pop up an interactive auth dialog const InteractiveAuthDialog = sdk.getComponent("dialogs.InteractiveAuthDialog"); - Modal.createTrackedDialog('Add Email', '', InteractiveAuthDialog, { + const { finished } = Modal.createTrackedDialog('Add Email', '', InteractiveAuthDialog, { title: _t("Add Email Address"), matrixClient: MatrixClientPeg.get(), authData: e.data, makeRequest: this._makeAddThreepidOnlyRequest, }); + return finished; } } } else { @@ -280,12 +281,13 @@ export default class AddThreepid { // pop up an interactive auth dialog const InteractiveAuthDialog = sdk.getComponent("dialogs.InteractiveAuthDialog"); - Modal.createTrackedDialog('Add MSISDN', '', InteractiveAuthDialog, { + const { finished } = Modal.createTrackedDialog('Add MSISDN', '', InteractiveAuthDialog, { title: _t("Add Phone Number"), matrixClient: MatrixClientPeg.get(), authData: e.data, makeRequest: this._makeAddThreepidOnlyRequest, }); + return finished; } } } else {