Return promises
This commit is contained in:
parent
a653fea020
commit
2040587826
1 changed files with 28 additions and 10 deletions
|
@ -188,11 +188,20 @@ export default class AddThreepid {
|
||||||
// pop up an interactive auth dialog
|
// pop up an interactive auth dialog
|
||||||
const InteractiveAuthDialog = sdk.getComponent("dialogs.InteractiveAuthDialog");
|
const InteractiveAuthDialog = sdk.getComponent("dialogs.InteractiveAuthDialog");
|
||||||
|
|
||||||
Modal.createTrackedDialog('Add Email', '', InteractiveAuthDialog, {
|
return new Promise((resolve, reject) => {
|
||||||
title: _t("Add Email Address"),
|
Modal.createTrackedDialog('Add Email', '', InteractiveAuthDialog, {
|
||||||
matrixClient: MatrixClientPeg.get(),
|
title: _t("Add Email Address"),
|
||||||
authData: e.data,
|
matrixClient: MatrixClientPeg.get(),
|
||||||
makeRequest: this._makeAddThreepidOnlyRequest,
|
authData: e.data,
|
||||||
|
makeRequest: this._makeAddThreepidOnlyRequest,
|
||||||
|
onFinished: (success) => {
|
||||||
|
if (success) {
|
||||||
|
resolve();
|
||||||
|
} else {
|
||||||
|
reject();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -280,11 +289,20 @@ export default class AddThreepid {
|
||||||
// pop up an interactive auth dialog
|
// pop up an interactive auth dialog
|
||||||
const InteractiveAuthDialog = sdk.getComponent("dialogs.InteractiveAuthDialog");
|
const InteractiveAuthDialog = sdk.getComponent("dialogs.InteractiveAuthDialog");
|
||||||
|
|
||||||
Modal.createTrackedDialog('Add MSISDN', '', InteractiveAuthDialog, {
|
return new Promise((resolve, reject) => {
|
||||||
title: _t("Add Phone Number"),
|
Modal.createTrackedDialog('Add MSISDN', '', InteractiveAuthDialog, {
|
||||||
matrixClient: MatrixClientPeg.get(),
|
title: _t("Add Phone Number"),
|
||||||
authData: e.data,
|
matrixClient: MatrixClientPeg.get(),
|
||||||
makeRequest: this._makeAddThreepidOnlyRequest,
|
authData: e.data,
|
||||||
|
makeRequest: this._makeAddThreepidOnlyRequest,
|
||||||
|
onFinished: (success) => {
|
||||||
|
if (success) {
|
||||||
|
resolve();
|
||||||
|
} else {
|
||||||
|
reject();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue