Skip to content

Commit

Permalink
Merge pull request Hubs-Foundation#4824 from mozilla/fix-twitter-popu…
Browse files Browse the repository at this point in the history
…p-issue

Popup window closes itself on oauth-success
  • Loading branch information
robinkwilson authored Nov 9, 2021
2 parents 3f2893a + 4de8404 commit a53a60b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions src/hub.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ let isOAuthModal = false;
if (window.opener && window.opener.doingTwitterOAuth) {
window.opener.postMessage("oauth-successful");
isOAuthModal = true;
window.close();
}

const isBotMode = qsTruthy("bot");
Expand Down
1 change: 0 additions & 1 deletion src/react-components/room/TwitterOAuthModalContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export function TwitterOAuthModalContainer({ hubChannel, onConnected, onClose })
function onMessage({ data }) {
if (data === "oauth-successful") {
onConnected();
popupRef.current.close();
popupRef.current = null;
delete window.doingTwitterOAuth;
window.removeEventListener("message", onMessage);
Expand Down

0 comments on commit a53a60b

Please sign in to comment.