浏览代码

[RN] Fix use of undefined APP

On RN we don't use the global APP object, so don't save the store there unless
it's defined, which is the case in the current web version. Also, check for
undefined explicitly, since a "if (!APP)" check will throw a ReferenceError.
master
Saúl Ibarra Corretgé 9 年前
父节点
当前提交
5b6985fc5c
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 3
    1
      react/features/app/components/AbstractApp.js
  2. 1
    1
      react/features/base/conference/middleware.js

+ 3
- 1
react/features/app/components/AbstractApp.js 查看文件

@@ -307,7 +307,9 @@ export class AbstractApp extends Component {
307 307
             // non-reactified parts of the code (conference.js for example).
308 308
             // Don't use in the react code!!!
309 309
             // FIXME: remove when the reactification is finished!
310
-            APP.store = store;
310
+            if (typeof APP !== 'undefined') {
311
+                APP.store = store;
312
+            }
311 313
         }
312 314
 
313 315
         return store;

+ 1
- 1
react/features/base/conference/middleware.js 查看文件

@@ -56,7 +56,7 @@ function _connectionEstablished(store, next, action) {
56 56
 
57 57
     // FIXME: workaround for the web version. Currently the creation of the
58 58
     // conference is handled by /conference.js
59
-    if (!APP) {
59
+    if (typeof APP === 'undefined') {
60 60
         store.dispatch(createConference());
61 61
     }
62 62
 

正在加载...
取消
保存