diff --git a/src/webpage/guild.ts b/src/webpage/guild.ts index 9379549..a305f71 100644 --- a/src/webpage/guild.ts +++ b/src/webpage/guild.ts @@ -915,7 +915,7 @@ class Guild extends SnowFlake { this.printServers(); return thischannel; } - createchannels(func = this.createChannel) { + createchannels(func = this.createChannel.bind(this)) { const options = ["text", "announcement", "voice"].map((e) => I18n.getTranslation("channel." + e), ); diff --git a/src/webpage/localuser.ts b/src/webpage/localuser.ts index ddb7b6e..d763b7f 100644 --- a/src/webpage/localuser.ts +++ b/src/webpage/localuser.ts @@ -127,18 +127,21 @@ class Localuser { this.guilds.push(temp); this.guildids.set(temp.id, temp); } - console.log(ready.d.user_guild_settings.entries); + if (ready.d.user_guild_settings) { + console.log(ready.d.user_guild_settings.entries); - for (const thing of ready.d.user_guild_settings.entries) { - (this.guildids.get(thing.guild_id) as Guild).notisetting(thing); - } - - for (const thing of ready.d.read_state.entries) { - const channel = this.channelids.get(thing.channel_id); - if (!channel) { - continue; + for (const thing of ready.d.user_guild_settings.entries) { + (this.guildids.get(thing.guild_id) as Guild).notisetting(thing); + } + } + if (ready.d.read_state) { + for (const thing of ready.d.read_state.entries) { + const channel = this.channelids.get(thing.channel_id); + if (!channel) { + continue; + } + channel.readStateInfo(thing); } - channel.readStateInfo(thing); } for (const thing of ready.d.relationships) { const user = new User(thing.user, this); diff --git a/src/webpage/style.css b/src/webpage/style.css index e706ff7..2a3de36 100644 --- a/src/webpage/style.css +++ b/src/webpage/style.css @@ -114,7 +114,10 @@ samp { text-wrap: wrap; word-break: break-word; } -video, +video { + max-height: 50svh; + max-width: 100%; +} iframe { /* max-height: 50svh; */ max-width: 100%;