[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.
This commit is contained in:
parent
18a81d7ca0
commit
a1da6bff1a
|
@ -99,11 +99,11 @@ function _setConfig(store, next, action) {
|
||||||
const disposeLibPromise
|
const disposeLibPromise
|
||||||
= initialized ? dispatch(disposeLib()) : Promise.resolve();
|
= initialized ? dispatch(disposeLib()) : Promise.resolve();
|
||||||
|
|
||||||
// Let the new config into the Redux store (because initLib will read it
|
disposeLibPromise.then(() => {
|
||||||
// from there).
|
// Let the new config into the Redux store (because initLib will read it
|
||||||
const nextState = next(action);
|
// from there).
|
||||||
|
next(action);
|
||||||
|
|
||||||
disposeLibPromise.then(dispatch(initLib()));
|
dispatch(initLib());
|
||||||
|
});
|
||||||
return nextState;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue