feat(packages/api): add force disconnecting and disconnected getter in APIClient

This commit is contained in:
PalmDevs
2024-07-30 21:02:42 +07:00
parent 8168f79ac6
commit a848a9c896
2 changed files with 8 additions and 4 deletions

View File

@@ -137,8 +137,8 @@ export class ClientWebSocketManager {
/**
* Disconnects from the WebSocket API
*/
disconnect() {
this.#throwIfDisconnected('Cannot disconnect when already disconnected from the server')
disconnect(force?: boolean) {
if (!force) this.#throwIfDisconnected('Cannot disconnect when already disconnected from the server')
this._handleDisconnect(DisconnectReason.PlannedDisconnect)
}