bottom snapping

This commit is contained in:
MathMan05
2025-09-16 15:04:09 -05:00
parent c1ecbc62b7
commit 6aa8619b20
2 changed files with 9 additions and 0 deletions
+7
View File
@@ -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<void> {
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();
+2
View File
@@ -3101,7 +3101,9 @@ class Localuser {
this.lookingguild?.markAsRead();
} else {
this.channelfocus?.readbottom();
this.channelfocus?.goToBottom();
}
return true;
}
return false;