fix(packages/api): handle close event as a disconnect

This commit is contained in:
PalmDevs
2024-08-04 02:47:00 +07:00
parent 65add4dfee
commit d90ad5c955

View File

@@ -77,7 +77,11 @@ export class ClientWebSocketManager {
} catch (e) {
rj(e)
}
}).finally(() => {
})
.then(() => {
this.#socket.on('close', (code, reason) => this._handleDisconnect(code, reason.toString()))
})
.finally(() => {
this.connecting = false
})
}