From f4ecd615c6e33f001b421bc1d020a67d1b56dac7 Mon Sep 17 00:00:00 2001 From: Paul Date: Sat, 27 Feb 2021 14:50:28 +0000 Subject: [PATCH] Log out properly. --- package.json | 2 +- src/Client.ts | 3 ++- src/index.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index fc148ae2..337d1240 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "revolt.js", - "version": "4.0.0-alpha.6", + "version": "4.0.0-alpha.7", "main": "dist/index.js", "repository": "https://gitlab.insrt.uk/revolt/revolt.js", "author": "Paul Makles ", diff --git a/src/Client.ts b/src/Client.ts index b1d05fbd..7f3eb288 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -211,8 +211,9 @@ export class Client extends EventEmitter { * Utility functions. */ async logout() { - this.reset(); + this.websocket.disconnect(); await this.req('GET', '/auth/logout'); + this.reset(); } reset() { diff --git a/src/index.ts b/src/index.ts index 10ce18b6..799e53b9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ export * from './Client'; export { Channel, User, Message } from './api/objects'; -export const LIBRARY_VERSION = '4.0.0-alpha.6'; +export const LIBRARY_VERSION = '4.0.0-alpha.7'; export const defaultConfig = { apiURL: 'https://api.revolt.chat',