You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-18 09:22:18 +03:00
Fix defer promise logic
This commit is contained in:
@ -773,15 +773,16 @@ module.exports = React.createClass({
|
|||||||
// If the user is a ROU, allow them to transition to a PWLU
|
// If the user is a ROU, allow them to transition to a PWLU
|
||||||
if (cli.isGuest()) {
|
if (cli.isGuest()) {
|
||||||
const SetMxIdDialog = sdk.getComponent('views.dialogs.SetMxIdDialog');
|
const SetMxIdDialog = sdk.getComponent('views.dialogs.SetMxIdDialog');
|
||||||
mxIdPromise = q.defer();
|
const defered = q.defer();
|
||||||
|
mxIdPromise = defered.promise;
|
||||||
Modal.createDialog(SetMxIdDialog, {
|
Modal.createDialog(SetMxIdDialog, {
|
||||||
onFinished: (submitted, credentials) => {
|
onFinished: (submitted, credentials) => {
|
||||||
if (!submitted) {
|
if (!submitted) {
|
||||||
mxIdPromise.reject();
|
defered.reject();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.props.onRegistered(credentials);
|
this.props.onRegistered(credentials);
|
||||||
mxIdPromise.resolve();
|
defered.resolve();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user