From cee523fbf1cdeab201a42ba8b2a575b88e8cbd4c Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Mon, 10 Jul 2017 17:43:29 -0500 Subject: [PATCH] fix(desktop_picker): Use defaultProps --- .../desktop-picker/components/DesktopPicker.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/react/features/desktop-picker/components/DesktopPicker.js b/react/features/desktop-picker/components/DesktopPicker.js index 9b1a241a5..53e410792 100644 --- a/react/features/desktop-picker/components/DesktopPicker.js +++ b/react/features/desktop-picker/components/DesktopPicker.js @@ -39,6 +39,15 @@ const VALID_TYPES = TAB_CONFIGURATIONS.map(c => c.type); * @extends Component */ class DesktopPicker extends Component { + /** + * Default values for DesktopPicker component's properties. + * + * @static + */ + static defaultProps = { + options: {} + }; + /** * DesktopPicker component's property types. * @@ -102,10 +111,10 @@ class DesktopPicker extends Component { * @inheritdoc */ componentWillMount() { - const options = this.props.options || {}; + const { desktopSharingSources } = this.props.options; this._onSourceTypesConfigChanged( - options.desktopSharingSources); + desktopSharingSources); this._updateSources(); this._startPolling(); } @@ -130,10 +139,10 @@ class DesktopPicker extends Component { }); } - const options = this.props.options || {}; + const { desktopSharingSources } = this.props.options; this._onSourceTypesConfigChanged( - options.desktopSharingSources); + desktopSharingSources); } /**