Преглед изворни кода

[RN] Fix loading config from non-default domains

When a conference is to happen in a domain which is not the defaut, its config
is loaded and set. As part of this process, lib-jitsi-meet is disposed. Because
disposing is asynchronous, events happen in this sequence:

- set new config
- dispose lib (which effectively wipes the config)
- init lib

This results in the library to be initialized without the loaded config, which
was lost. This commit fixes that by delaying setting the config and
re-initializing the library until it was disposed.
j8
Saúl Ibarra Corretgé пре 8 година
родитељ
комит
a1da6bff1a
1 измењених фајлова са 6 додато и 6 уклоњено
  1. 6
    6
      react/features/base/lib-jitsi-meet/middleware.js

+ 6
- 6
react/features/base/lib-jitsi-meet/middleware.js Прегледај датотеку

@@ -99,11 +99,11 @@ function _setConfig(store, next, action) {
99 99
     const disposeLibPromise
100 100
         = initialized ? dispatch(disposeLib()) : Promise.resolve();
101 101
 
102
-    // Let the new config into the Redux store (because initLib will read it
103
-    // from there).
104
-    const nextState = next(action);
105
-
106
-    disposeLibPromise.then(dispatch(initLib()));
102
+    disposeLibPromise.then(() => {
103
+        // Let the new config into the Redux store (because initLib will read it
104
+        // from there).
105
+        next(action);
107 106
 
108
-    return nextState;
107
+        dispatch(initLib());
108
+    });
109 109
 }

Loading…
Откажи
Сачувај