From c890856ce36ef2b7fa76f1c897bc6738fc4ffb46 Mon Sep 17 00:00:00 2001 From: MathMan05 Date: Tue, 3 Sep 2024 11:12:26 -0500 Subject: [PATCH] small patches --- .dist/channel.js | 2 +- .dist/direct.js | 2 +- .dist/guild.js | 2 +- tsconfig.json | 2 +- webpage/channel.ts | 2 +- webpage/direct.ts | 2 +- webpage/guild.ts | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.dist/channel.js b/.dist/channel.js index 88095bb..a029bf9 100644 --- a/.dist/channel.js +++ b/.dist/channel.js @@ -198,7 +198,7 @@ class Channel extends SnowFlake { return false; }), this.readbottom.bind(this)); } - constructor(json, owner, id = json === -1 ? undefined : json.id) { + constructor(json, owner, id = json === -1 ? "" : json.id) { super(id); if (json === -1) { return; diff --git a/.dist/direct.js b/.dist/direct.js index e675b66..828cfc2 100644 --- a/.dist/direct.js +++ b/.dist/direct.js @@ -86,7 +86,7 @@ class Group extends Channel { this.user = this.localuser.user; } this.name ??= this.localuser.user.username; - this.parent_id = null; + this.parent_id = undefined; this.parent = null; this.children = []; this.guild_id = "@me"; diff --git a/.dist/guild.js b/.dist/guild.js index 7e58f07..38238bc 100644 --- a/.dist/guild.js +++ b/.dist/guild.js @@ -70,7 +70,7 @@ class Guild extends SnowFlake { settings.show(); } constructor(json, owner, member) { - if (json === -1) { + if (json === -1 || member === null) { super("@me"); return; } diff --git a/tsconfig.json b/tsconfig.json index 71aba3f..e59ead1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,7 @@ "removeComments": false, "noImplicitThis":true, "useUnknownInCatchVariables":true, - "strictNullChecks":false + "strictNullChecks":true }, "include": [ "./webpage/*.ts" diff --git a/webpage/channel.ts b/webpage/channel.ts index f584dcf..5df523d 100644 --- a/webpage/channel.ts +++ b/webpage/channel.ts @@ -210,7 +210,7 @@ class Channel extends SnowFlake{ this.readbottom.bind(this) ); } - constructor(json:channeljson|-1,owner:Guild,id:string=json===-1?undefined:json.id){ + constructor(json:channeljson|-1,owner:Guild,id:string=json===-1?"":json.id){ super(id); if(json===-1){ return; diff --git a/webpage/direct.ts b/webpage/direct.ts index 78f5e75..6a353ba 100644 --- a/webpage/direct.ts +++ b/webpage/direct.ts @@ -92,7 +92,7 @@ class Group extends Channel{ this.user=this.localuser.user; } this.name??=this.localuser.user.username; - this.parent_id=null; + this.parent_id=undefined; this.parent=null; this.children=[]; this.guild_id="@me"; diff --git a/webpage/guild.ts b/webpage/guild.ts index 9a8c410..60ec004 100644 --- a/webpage/guild.ts +++ b/webpage/guild.ts @@ -79,8 +79,8 @@ class Guild extends SnowFlake{ s1.options.push(new RoleList(permlist,this,this.updateRolePermissions.bind(this))); settings.show(); } - constructor(json:guildjson|-1,owner:Localuser,member:memberjson|User){ - if(json===-1){ + constructor(json:guildjson|-1,owner:Localuser,member:memberjson|User|null){ + if(json===-1||member===null){ super("@me"); return; }