Compare commits

..

No commits in common. "54a817742c60cc9f886072245ad74faec349eb2f" and "72324beb6837425149b9ab93dc5a0561ad3ed5be" have entirely different histories.

2 changed files with 6 additions and 6 deletions

4
dist/index.js vendored
View File

@ -39,11 +39,11 @@ export class SwarmClient extends Client {
if (this._ready) {
return this._ready;
}
this._ready = this.callModuleReturn("ready", { swarm: this.swarm });
await this._ready;
this.connectModule("listenConnections", { swarm: this.swarm }, async (socketId) => {
this.emit("connection", await createSocket(socketId));
});
this._ready = this.callModuleReturn("ready", { swarm: this.swarm });
await this._ready;
this._ready = undefined;
}
async start() {

View File

@ -53,6 +53,10 @@ export class SwarmClient extends Client {
return this._ready;
}
this._ready = this.callModuleReturn("ready", { swarm: this.swarm });
await this._ready;
this.connectModule(
"listenConnections",
{ swarm: this.swarm },
@ -61,10 +65,6 @@ export class SwarmClient extends Client {
}
);
this._ready = this.callModuleReturn("ready", { swarm: this.swarm });
await this._ready;
this._ready = undefined;
}