Skip to content

Commit

Permalink
refactor: wait for SFU joined then call onjoin (ionorg#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
avxit committed Jul 21, 2021
1 parent 1e76031 commit c2e3a39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) => {
Expand Down

0 comments on commit c2e3a39

Please sign in to comment.