Bläddra i källkod

[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.
master
Saúl Ibarra Corretgé 8 år sedan
förälder
incheckning
a1da6bff1a
1 ändrade filer med 6 tillägg och 6 borttagningar
  1. 6
    6
      react/features/base/lib-jitsi-meet/middleware.js

+ 6
- 6
react/features/base/lib-jitsi-meet/middleware.js Visa fil

99
     const disposeLibPromise
99
     const disposeLibPromise
100
         = initialized ? dispatch(disposeLib()) : Promise.resolve();
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
 }

Laddar…
Avbryt
Spara