Remove override of UserConfig

This commit is contained in:
Val Lorentz 2023-03-15 10:49:56 +01:00
parent d58fb84565
commit 320075e376
2 changed files with 4 additions and 9 deletions

View file

@ -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,

View file

@ -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}`);