diff --git a/src/webpage/channel.ts b/src/webpage/channel.ts index 7cd976c..2b81e2f 100644 --- a/src/webpage/channel.ts +++ b/src/webpage/channel.ts @@ -2246,6 +2246,10 @@ class Channel extends SnowFlake { } } } + async goToBottom() { + await this.tryfocusinfinate(); + if (this.lastmessageid) this.infinite.focus(this.lastmessageid); + } async messageCreate(messagep: messageCreateJson): Promise { if (this.localuser.channelfocus !== this) { if (this.fakeMessageMap.has(this.id)) { @@ -2272,6 +2276,9 @@ class Channel extends SnowFlake { if (next) { next.generateMessage(); } + if (this == this.localuser.channelfocus) { + await this.goToBottom(); + } } this.unreads(); this.guild.unreads(); diff --git a/src/webpage/localuser.ts b/src/webpage/localuser.ts index 3820035..fcd61b0 100644 --- a/src/webpage/localuser.ts +++ b/src/webpage/localuser.ts @@ -3101,7 +3101,9 @@ class Localuser { this.lookingguild?.markAsRead(); } else { this.channelfocus?.readbottom(); + this.channelfocus?.goToBottom(); } + return true; } return false;