Selaa lähdekoodia

[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é 8 vuotta sitten
vanhempi
commit
5b6985fc5c

+ 3
- 1
react/features/app/components/AbstractApp.js Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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
 

Loading…
Peruuta
Tallenna