aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaúl Ibarra Corretgé <s@saghul.net>2018-10-10 10:20:44 +0200
committerHristo Terezov <hristo@jitsi.org>2018-10-10 12:22:04 -0500
commitb8ed209893cde7a9dcf757974f2cdc52d419848f (patch)
tree47f548191bcf3ab7f83c41af37c155b580357ca8
parentda8f51dc5167bd036c2cee3cb3d3c8d201829567 (diff)
Fix regression when conference has a password or auth
This partially reverts eec6a270c5b2c7c93891dee1f9b49cfd351f7cff. The problem is that when a conference is protected by a password or has auth enabled, the "joined" event will come later, when the user authenticates, so the 10s timeout will kick in. This is not ideal because we react to the onLoad event of an iframe, which doesn't tell us much of *what* is actually loaded, but a new event would be required to properly fix this.
-rw-r--r--app/features/conference/components/Conference.js23
1 files changed, 18 insertions, 5 deletions
diff --git a/app/features/conference/components/Conference.js b/app/features/conference/components/Conference.js
index 09f819d..1ee0ea5 100644
--- a/app/features/conference/components/Conference.js
+++ b/app/features/conference/components/Conference.js
@@ -110,6 +110,8 @@ class Conference extends Component<Props, State> {
};
this._ref = React.createRef();
+
+ this._onIframeLoad = this._onIframeLoad.bind(this);
}
/**
@@ -139,7 +141,8 @@ class Conference extends Component<Props, State> {
this._ref.current.appendChild(script);
- // Set a timer for 10s, if we haven't joined by then, give up.
+ // Set a timer for 10s, if we haven't loaded the iframe by then,
+ // give up.
this._loadTimer = setTimeout(() => {
this._navigateToHome(
@@ -250,6 +253,7 @@ class Conference extends Component<Props, State> {
this._api = new JitsiMeetExternalAPI(host, {
configOverwrite,
+ onload: this._onIframeLoad,
parentNode,
roomName: this._conference.room
});
@@ -300,14 +304,14 @@ class Conference extends Component<Props, State> {
}
}
+ _onIframeLoad: (*) => void;
+
/**
- * Saves conference info on joining it.
+ * Sets state of loading to false when iframe has completely loaded.
*
- * @param {Object} conferenceInfo - Contains information about the current
- * conference.
* @returns {void}
*/
- _onVideoConferenceJoined(conferenceInfo: Object) {
+ _onIframeLoad() {
if (this._loadTimer) {
clearTimeout(this._loadTimer);
this._loadTimer = null;
@@ -316,7 +320,16 @@ class Conference extends Component<Props, State> {
this.setState({
isLoading: false
});
+ }
+ /**
+ * Saves conference info on joining it.
+ *
+ * @param {Object} conferenceInfo - Contains information about the current
+ * conference.
+ * @returns {void}
+ */
+ _onVideoConferenceJoined(conferenceInfo: Object) {
setupDragAreas(this._api.getIFrame());
this._setAvatarURL(this.props._avatarURL);