Merge pull request #3298 from matrix-org/t3chguy/Modal.createX_promise

change Modal async/await signature to use raw promises
This commit is contained in:
Michael Telatynski 2019-08-09 18:16:40 +01:00 committed by GitHub
commit 75bcd61934
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -274,7 +274,7 @@ class ModalManager {
this._reRender(); this._reRender();
return { return {
close: closeDialog, close: closeDialog,
then: (resolve, reject) => onFinishedProm.then(resolve, reject), finished: onFinishedProm,
}; };
} }
@ -285,7 +285,7 @@ class ModalManager {
this._reRender(); this._reRender();
return { return {
close: closeDialog, close: closeDialog,
then: (resolve, reject) => onFinishedProm.then(resolve, reject), finished: onFinishedProm,
}; };
} }

View file

@ -935,7 +935,7 @@ export default React.createClass({
const CreateRoomDialog = sdk.getComponent('dialogs.CreateRoomDialog'); const CreateRoomDialog = sdk.getComponent('dialogs.CreateRoomDialog');
const modal = Modal.createTrackedDialog('Create Room', '', CreateRoomDialog); const modal = Modal.createTrackedDialog('Create Room', '', CreateRoomDialog);
const [shouldCreate, name, noFederate] = await modal; const [shouldCreate, name, noFederate] = await modal.finished;
if (shouldCreate) { if (shouldCreate) {
const createOpts = {}; const createOpts = {};
if (name) createOpts.name = name; if (name) createOpts.name = name;