From 320075e376eecc0843f57b2f9b3207f8f245930e Mon Sep 17 00:00:00 2001 From: Val Lorentz Date: Wed, 15 Mar 2023 10:49:56 +0100 Subject: [PATCH] Remove override of UserConfig --- server/client.ts | 11 +++-------- server/clientManager.ts | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/server/client.ts b/server/client.ts index c34ab0e3..d5ffe84e 100644 --- a/server/client.ts +++ b/server/client.ts @@ -78,6 +78,7 @@ export type UserConfig = { hostname?: string; isSecure?: boolean; }; + networks?: NetworkConfig[]; }; export type Mention = { @@ -95,9 +96,7 @@ class Client { attachedClients!: { [socketId: string]: {token: string; openChannel: number}; }; - config!: UserConfig & { - networks?: NetworkConfig[]; - }; + config!: UserConfig; id!: number; idMsg!: number; idChan!: number; @@ -112,11 +111,7 @@ class Client { fileHash!: string; - constructor( - manager: ClientManager, - name?: string, - config = {} as UserConfig & {networks: NetworkConfig[]} - ) { + constructor(manager: ClientManager, name?: string, config = {} as UserConfig) { _.merge(this, { awayMessage: "", lastActiveChannel: -1, diff --git a/server/clientManager.ts b/server/clientManager.ts index 85055d88..78e94d18 100644 --- a/server/clientManager.ts +++ b/server/clientManager.ts @@ -285,7 +285,7 @@ class ClientManager { try { const data = fs.readFileSync(userPath, "utf-8"); - return JSON.parse(data) as UserConfig & {networks: NetworkConfig[]}; + return JSON.parse(data) as UserConfig; } catch (e: any) { // eslint-disable-next-line @typescript-eslint/restrict-template-expressions log.error(`Failed to read user ${colors.bold(name)}: ${e}`);