diff --git a/modules/UI/welcome_page/WelcomePage.js b/modules/UI/welcome_page/WelcomePage.js
index 5a244c902..6777ff23a 100644
--- a/modules/UI/welcome_page/WelcomePage.js
+++ b/modules/UI/welcome_page/WelcomePage.js
@@ -13,10 +13,8 @@ function enterRoom() {
}
function setupWelcomePage() {
- /*
- * XXX: We left only going to conference page here because transitions via
- * React Router isn't implemented yet.
- */
+ // XXX: We left only going to conference page here because transitions via
+ // React Router isn't implemented yet.
$("#enter_room_button").click(function() {
enterRoom();
diff --git a/react/features/welcome/components/AbstractWelcomePage.js b/react/features/welcome/components/AbstractWelcomePage.js
index b65d45b92..e8e2b312b 100644
--- a/react/features/welcome/components/AbstractWelcomePage.js
+++ b/react/features/welcome/components/AbstractWelcomePage.js
@@ -36,31 +36,30 @@ export class AbstractWelcomePage extends Component {
* Save room name into component's local state.
*
* @type {Object}
+ * @property {number|null} animateTimeoutId - Identificator for
+ * letter animation timeout.
+ * @property {string} generatedRoomname - Automatically generated
+ * room name.
* @property {string} room - Room name.
* @property {string} roomPlaceholder - Room placeholder
* that's used as a placeholder for input.
- * @property {string} generatedRoomname - Automatically generated
- * room name.
- * @property {number|null} animateTimeoutId - Identificator for
- * letter animation timeout.
* @property {nubmer|null} updateTimeoutId - Identificator for
* updating generated room name.
*/
this.state = {
+ animateTimeoutId: null,
+ generatedRoomname: '',
room: '',
roomPlaceholder: '',
- generatedRoomname: '',
- animateTimeoutId: null,
updateTimeoutId: null
};
// Bind event handlers so they are only bound once for every instance.
- const roomnameChanging = this._animateRoomnameChanging.bind(this);
-
+ this._animateRoomnameChanging
+ = this._animateRoomnameChanging.bind(this);
this._onJoin = this._onJoin.bind(this);
this._onRoomChange = this._onRoomChange.bind(this);
this._updateRoomname = this._updateRoomname.bind(this);
- this._animateRoomnameChanging = roomnameChanging.bind(this);
}
/**
@@ -74,20 +73,48 @@ export class AbstractWelcomePage extends Component {
}
/**
- * This method is executed when method will be unmounted from DOM.
- *
- * @inheritdoc
- */
+ * This method is executed when method will be unmounted from DOM.
+ *
+ * @inheritdoc
+ */
componentWillUnmount() {
this._clearTimeouts();
}
/**
- * Method that clears timeouts for animations and updates of room name.
- *
- * @private
- * @returns {void}
- */
+ * Animates the changing of the room name.
+ *
+ * @param {string} word - The part of room name that should be added to
+ * placeholder.
+ * @private
+ * @returns {void}
+ */
+ _animateRoomnameChanging(word) {
+ let animateTimeoutId = null;
+ const roomPlaceholder = this.state.roomPlaceholder + word.substr(0, 1);
+
+ if (word.length > 1) {
+ animateTimeoutId
+ = setTimeout(
+ () => {
+ this._animateRoomnameChanging(
+ word.substring(1, word.length));
+ },
+ 70);
+ }
+
+ this.setState({
+ animateTimeoutId,
+ roomPlaceholder
+ });
+ }
+
+ /**
+ * Method that clears timeouts for animations and updates of room name.
+ *
+ * @private
+ * @returns {void}
+ */
_clearTimeouts() {
clearTimeout(this.state.animateTimeoutId);
clearTimeout(this.state.updateTimeoutId);
@@ -105,50 +132,6 @@ export class AbstractWelcomePage extends Component {
return !isRoomValid(this.state.room);
}
- /**
- * Method triggering generation of new room name and
- * initiating animation of its changing.
- *
- * @protected
- * @returns {void}
- */
- _updateRoomname() {
- const generatedRoomname = generateRoomWithoutSeparator();
- const roomPlaceholder = '';
- const updateTimeoutId = setTimeout(this._updateRoomname, 10000);
-
- this._clearTimeouts();
- this.setState({
- updateTimeoutId,
- generatedRoomname,
- roomPlaceholder
- }, () => this._animateRoomnameChanging(generatedRoomname));
- }
-
- /**
- * Method animating changing room name.
- *
- * @param {string} word - The part of room name that should
- * be added to placeholder.
- * @private
- * @returns {void}
- */
- _animateRoomnameChanging(word) {
- const roomPlaceholder = this.state.roomPlaceholder + word.substr(0, 1);
- let animateTimeoutId = null;
-
- if (word.length > 1) {
- animateTimeoutId = setTimeout(() => {
- this._animateRoomnameChanging(word.substring(1, word.length));
- }, 70);
- }
-
- this.setState({
- animateTimeoutId,
- roomPlaceholder
- });
- }
-
/**
* Handles joining. Either by clicking on 'Join' button
* or by pressing 'Enter' in room name input field.
@@ -157,12 +140,10 @@ export class AbstractWelcomePage extends Component {
* @returns {void}
*/
_onJoin() {
- const { room, generatedRoomname } = this.state;
+ const room = this.state.room || this.state.generatedRoomname;
- if (room && room.length) {
+ if (room) {
this.props.dispatch(appNavigate(room));
- } else {
- this.props.dispatch(appNavigate(generatedRoomname));
}
}
@@ -189,6 +170,28 @@ export class AbstractWelcomePage extends Component {