diff --git a/src/index.ts b/src/index.ts index d50e8da..db05469 100644 --- a/src/index.ts +++ b/src/index.ts @@ -53,10 +53,6 @@ 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 }, @@ -65,6 +61,10 @@ export class SwarmClient extends Client { } ); + this._ready = this.callModuleReturn("ready", { swarm: this.swarm }); + + await this._ready; + this._ready = undefined; }