浏览代码

fix(desktop_picker): Use defaultProps

j8
hristoterezov 7 年前
父节点
当前提交
cee523fbf1
共有 1 个文件被更改,包括 13 次插入4 次删除
  1. 13
    4
      react/features/desktop-picker/components/DesktopPicker.js

+ 13
- 4
react/features/desktop-picker/components/DesktopPicker.js 查看文件

39
  * @extends Component
39
  * @extends Component
40
  */
40
  */
41
 class DesktopPicker extends Component {
41
 class DesktopPicker extends Component {
42
+    /**
43
+     * Default values for DesktopPicker component's properties.
44
+     *
45
+     * @static
46
+     */
47
+    static defaultProps = {
48
+        options: {}
49
+    };
50
+
42
     /**
51
     /**
43
      * DesktopPicker component's property types.
52
      * DesktopPicker component's property types.
44
      *
53
      *
102
      * @inheritdoc
111
      * @inheritdoc
103
      */
112
      */
104
     componentWillMount() {
113
     componentWillMount() {
105
-        const options = this.props.options || {};
114
+        const { desktopSharingSources } = this.props.options;
106
 
115
 
107
         this._onSourceTypesConfigChanged(
116
         this._onSourceTypesConfigChanged(
108
-            options.desktopSharingSources);
117
+            desktopSharingSources);
109
         this._updateSources();
118
         this._updateSources();
110
         this._startPolling();
119
         this._startPolling();
111
     }
120
     }
130
             });
139
             });
131
         }
140
         }
132
 
141
 
133
-        const options = this.props.options || {};
142
+        const { desktopSharingSources } = this.props.options;
134
 
143
 
135
         this._onSourceTypesConfigChanged(
144
         this._onSourceTypesConfigChanged(
136
-            options.desktopSharingSources);
145
+            desktopSharingSources);
137
     }
146
     }
138
 
147
 
139
     /**
148
     /**

正在加载...
取消
保存