mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
fix(conference): Make sure join waits for confernce.init.
It was possible that join can be executed before conference.init have even started or we haven't reached the point ot create the initialGUMPromise. This was causing the following issues: - users stuck on the prejoin screen - participants join 2+ times in the call (we have been creating more than 1 local participants from a single page).
This commit is contained in:
@@ -22,16 +22,21 @@ export function assignIfDefined(target: Object, source: Object) {
|
||||
return to;
|
||||
}
|
||||
|
||||
export type DefferedPromise<T> = {
|
||||
promise: Promise<T>;
|
||||
reject: (reason?: any) => void;
|
||||
resolve: (value: T) => void;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a deferred object.
|
||||
*
|
||||
* @returns {{promise, resolve, reject}}
|
||||
*/
|
||||
export function createDeferred() {
|
||||
const deferred: any = {};
|
||||
export function createDeferred<T>() {
|
||||
const deferred = {} as DefferedPromise<T>;
|
||||
|
||||
deferred.promise = new Promise((resolve, reject) => {
|
||||
deferred.promise = new Promise<T>((resolve, reject) => {
|
||||
deferred.resolve = resolve;
|
||||
deferred.reject = reject;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user