From 0eb0d242d56b24286f48da6eabacf2f0af57d537 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 29 Jan 2021 13:05:09 +0000 Subject: [PATCH] Apply suggestions from code review Co-authored-by: J. Ryan Stinnett --- src/components/structures/InteractiveAuth.js | 3 ++- src/components/views/auth/InteractiveAuthEntryComponents.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/structures/InteractiveAuth.js b/src/components/structures/InteractiveAuth.js index 23e43da195..ac7049ed88 100644 --- a/src/components/structures/InteractiveAuth.js +++ b/src/components/structures/InteractiveAuth.js @@ -179,7 +179,8 @@ export default class InteractiveAuthComponent extends React.Component { }, () => { if (oldStage !== stageType) { this._setFocus(); - } else if (!stageState.error && this._stageComponent.current && + } else if ( + !stageState.error && this._stageComponent.current && this._stageComponent.current.attemptFailed ) { this._stageComponent.current.attemptFailed(); diff --git a/src/components/views/auth/InteractiveAuthEntryComponents.js b/src/components/views/auth/InteractiveAuthEntryComponents.js index c8469192d2..7dc1976641 100644 --- a/src/components/views/auth/InteractiveAuthEntryComponents.js +++ b/src/components/views/auth/InteractiveAuthEntryComponents.js @@ -626,6 +626,7 @@ export class SSOAuthEntry extends React.Component { window.removeEventListener("message", this._onReceiveMessage); if (this._popupWindow) { this._popupWindow.close(); + this._popupWindow = null; } } @@ -639,6 +640,7 @@ export class SSOAuthEntry extends React.Component { if (event.data === "authDone" && event.origin === this.props.matrixClient.getHomeserverUrl()) { if (this._popupWindow) { this._popupWindow.close(); + this._popupWindow = null; } } };