diff --git a/src/ion.ts b/src/ion.ts index ffe2992f..68f265c3 100644 --- a/src/ion.ts +++ b/src/ion.ts @@ -89,9 +89,6 @@ export class IonConnector { this._biz = new BizClient(url); this._biz.on('join-reply', async (success: boolean, reason: string) => { - if (this.onjoin) { - this.onjoin(success, reason); - } if (success && !this._sfu) { const signal = new IonSFUGRPCWebSignal(url); const sfu = new Client(signal, config); @@ -104,6 +101,9 @@ export class IonConnector { await sfu.join(this._sid, this._uid); } + if (this.onjoin) { + this.onjoin(success, reason); + } }); this._biz.on('leave-reply', (reason: string) => {