From 36d126f3a9f9aa07be401e0265f0c1d3cf0d7b54 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 13 Feb 2017 19:09:43 +0000 Subject: [PATCH] PR feedback --- src/components/structures/InteractiveAuth.js | 10 ++++------ src/components/views/dialogs/BaseDialog.js | 2 -- src/components/views/dialogs/InteractiveAuthDialog.js | 4 ---- .../views/login/InteractiveAuthEntryComponents.js | 6 +++--- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/components/structures/InteractiveAuth.js b/src/components/structures/InteractiveAuth.js index c29b0fe16a..70b3c2e306 100644 --- a/src/components/structures/InteractiveAuth.js +++ b/src/components/structures/InteractiveAuth.js @@ -38,6 +38,10 @@ export default React.createClass({ // callback makeRequest: React.PropTypes.func.isRequired, + // callback called when the auth process has finished + // @param {bool} status True if the operation requiring + // auth was completed sucessfully, false if canceled. + // @param result The result of the authenticated call onFinished: React.PropTypes.func.isRequired, }, @@ -107,10 +111,6 @@ export default React.createClass({ } }, - _onCancel: function() { - this.props.onFinished(false); - }, - _submitAuthDict: function(authData) { this._authLogic.submitAuthDict(authData); }, @@ -131,8 +131,6 @@ export default React.createClass({ }, render: function() { - const Loader = sdk.getComponent("elements.Spinner"); - let error = null; if (this.state.errorText) { error = ( diff --git a/src/components/views/dialogs/BaseDialog.js b/src/components/views/dialogs/BaseDialog.js index 01a16e86ac..e83403ef7c 100644 --- a/src/components/views/dialogs/BaseDialog.js +++ b/src/components/views/dialogs/BaseDialog.js @@ -61,8 +61,6 @@ export default React.createClass({ }, _onCancelClick: function(e) { - e.stopPropagation(); - e.preventDefault(); this.props.onFinished(); }, diff --git a/src/components/views/dialogs/InteractiveAuthDialog.js b/src/components/views/dialogs/InteractiveAuthDialog.js index ecca00358f..66b662b23d 100644 --- a/src/components/views/dialogs/InteractiveAuthDialog.js +++ b/src/components/views/dialogs/InteractiveAuthDialog.js @@ -49,10 +49,6 @@ export default React.createClass({ }; }, - _onCancelClick: function() { - this.props.onFinished(false); - }, - render: function() { const InteractiveAuth = sdk.getComponent("structures.InteractiveAuth"); const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); diff --git a/src/components/views/login/InteractiveAuthEntryComponents.js b/src/components/views/login/InteractiveAuthEntryComponents.js index 4759a30c88..62f59472ec 100644 --- a/src/components/views/login/InteractiveAuthEntryComponents.js +++ b/src/components/views/login/InteractiveAuthEntryComponents.js @@ -21,7 +21,7 @@ import sdk from '../../../index'; import MatrixClientPeg from '../../../MatrixClientPeg'; /* This file contains a collection of components which are used by the - * InteractiveAuthDialog to prompt the user to enter the information needed + * InteractiveAuth to prompt the user to enter the information needed * for an auth stage. (The intention is that they could also be used for other * components, such as the registration flow). * @@ -187,7 +187,7 @@ export const FallbackAuthEntry = React.createClass({ } }, - onSubmitClick: function() { + _onShowFallbackClick: function() { var url = MatrixClientPeg.get().getFallbackAuthUrl( this.props.loginType, this.props.authSessionId @@ -207,7 +207,7 @@ export const FallbackAuthEntry = React.createClass({ render: function() { return (
- Click "Submit" to authenticate + Start authentication
{this.props.errorText}