fix(desktop_picker): Use defaultProps

This commit is contained in:
hristoterezov 2017-07-10 17:43:29 -05:00
parent 0481e4cf00
commit cee523fbf1
1 changed files with 13 additions and 4 deletions

View File

@ -39,6 +39,15 @@ const VALID_TYPES = TAB_CONFIGURATIONS.map(c => c.type);
* @extends Component * @extends Component
*/ */
class DesktopPicker extends Component { class DesktopPicker extends Component {
/**
* Default values for DesktopPicker component's properties.
*
* @static
*/
static defaultProps = {
options: {}
};
/** /**
* DesktopPicker component's property types. * DesktopPicker component's property types.
* *
@ -102,10 +111,10 @@ class DesktopPicker extends Component {
* @inheritdoc * @inheritdoc
*/ */
componentWillMount() { componentWillMount() {
const options = this.props.options || {}; const { desktopSharingSources } = this.props.options;
this._onSourceTypesConfigChanged( this._onSourceTypesConfigChanged(
options.desktopSharingSources); desktopSharingSources);
this._updateSources(); this._updateSources();
this._startPolling(); this._startPolling();
} }
@ -130,10 +139,10 @@ class DesktopPicker extends Component {
}); });
} }
const options = this.props.options || {}; const { desktopSharingSources } = this.props.options;
this._onSourceTypesConfigChanged( this._onSourceTypesConfigChanged(
options.desktopSharingSources); desktopSharingSources);
} }
/** /**