diff --git a/src/golem-network/golem-network.ts b/src/golem-network/golem-network.ts index 6c00f5908..31974e1e7 100644 --- a/src/golem-network/golem-network.ts +++ b/src/golem-network/golem-network.ts @@ -356,15 +356,14 @@ export class GolemNetwork { * @return Resolves when all shutdown steps are completed */ async disconnect() { - if (!this.isConnected()) { - return; - } if (this.disconnectPromise) { return this.disconnectPromise; } + this.disconnectPromise = this.startDisconnect().finally(() => { this.disconnectPromise = undefined; }); + return this.disconnectPromise; }