From 436bc87a863689b0bc17d18c9e9136de18e9f13b Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Wed, 22 Feb 2017 12:57:07 -0600 Subject: [PATCH] fix(overlay): comments after review --- .../overlay/components/OverlayContainer.js | 52 +++++++++---------- .../overlay/components/ReloadTimer.js | 16 ++++-- .../overlay/components/SuspendedOverlay.js | 1 - react/features/overlay/reducer.js | 2 +- 4 files changed, 40 insertions(+), 31 deletions(-) diff --git a/react/features/overlay/components/OverlayContainer.js b/react/features/overlay/components/OverlayContainer.js index 0b76e8398..5e6f3d502 100644 --- a/react/features/overlay/components/OverlayContainer.js +++ b/react/features/overlay/components/OverlayContainer.js @@ -50,6 +50,17 @@ class OverlayContainer extends Component { */ _haveToReload: React.PropTypes.bool, + /** + * The indicator which determines whether the GUM permissions prompt is + * displayed or not. + * + * NOTE: Used by UserMediaPermissionsOverlay only. + * + * @private + * @type {boolean} + */ + _isMediaPermissionPromptVisible: React.PropTypes.bool, + /** * The indicator which determines whether the reload was caused by * network failure. @@ -61,17 +72,6 @@ class OverlayContainer extends Component { */ _isNetworkFailure: React.PropTypes.bool, - /** - * The indicator which determines whether the GUM permissions prompt is - * displayed or not. - * - * NOTE: Used by UserMediaPermissionsOverlay only. - * - * @private - * @type {boolean} - */ - _mediaPermissionPromptVisible: React.PropTypes.bool, - /** * The reason for the error that will cause the reload. * @@ -106,7 +106,7 @@ class OverlayContainer extends Component { APP.UI.overlayVisible = (this.props._connectionEstablished && this.props._haveToReload) || this.props._suspendDetected - || this.props._mediaPermissionPromptVisible; + || this.props._isMediaPermissionPromptVisible; } /** @@ -131,7 +131,7 @@ class OverlayContainer extends Component { ); } - if (this.props._mediaPermissionPromptVisible) { + if (this.props._isMediaPermissionPromptVisible) { return ( @@ -151,7 +151,7 @@ class OverlayContainer extends Component { * _connectionEstablished: bool, * _haveToReload: bool, * _isNetworkFailure: bool, - * _mediaPermissionPromptVisible: bool, + * _isMediaPermissionPromptVisible: bool, * _reason: string, * _suspendDetected: bool * }} @@ -193,6 +193,18 @@ function _mapStateToProps(state) { */ _haveToReload: stateFeaturesOverlay.haveToReload, + /** + * The indicator which determines whether the GUM permissions prompt is + * displayed or not. + * + * NOTE: Used by UserMediaPermissionsOverlay only. + * + * @private + * @type {boolean} + */ + _isMediaPermissionPromptVisible: + stateFeaturesOverlay.isMediaPermissionPromptVisible, + /** * The indicator which determines whether the reload was caused by * network failure. @@ -204,18 +216,6 @@ function _mapStateToProps(state) { */ _isNetworkFailure: stateFeaturesOverlay.isNetworkFailure, - /** - * The indicator which determines whether the GUM permissions prompt is - * displayed or not. - * - * NOTE: Used by UserMediaPermissionsOverlay only. - * - * @private - * @type {boolean} - */ - _mediaPermissionPromptVisible: - stateFeaturesOverlay.mediaPermissionPromptVisible, - /** * The reason for the error that will cause the reload. * diff --git a/react/features/overlay/components/ReloadTimer.js b/react/features/overlay/components/ReloadTimer.js index a5dde0619..e9bd3f4ed 100644 --- a/react/features/overlay/components/ReloadTimer.js +++ b/react/features/overlay/components/ReloadTimer.js @@ -66,7 +66,19 @@ export default class ReloadTimer extends Component { super(props); this.state = { + /** + * Current value(time) of the timer. + * + * @type {number} + */ current: this.props.start, + + /** + * The absolute value of the time from the start of the timer until + * the end of the timer. + * + * @type {number} + */ time: Math.abs(this.props.end - this.props.start) }; } @@ -127,9 +139,7 @@ export default class ReloadTimer extends Component { id = 'reloadProgressBar'> - + { this.state.current } diff --git a/react/features/overlay/components/SuspendedOverlay.js b/react/features/overlay/components/SuspendedOverlay.js index 011d544d2..7a129e99a 100644 --- a/react/features/overlay/components/SuspendedOverlay.js +++ b/react/features/overlay/components/SuspendedOverlay.js @@ -29,7 +29,6 @@ export default class SuspendedOverlay extends AbstractOverlay {