mirror of
https://github.com/MathMan05/Fermi.git
synced 2026-05-15 01:35:15 +00:00
bottom snapping
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -3101,7 +3101,9 @@ class Localuser {
|
||||
this.lookingguild?.markAsRead();
|
||||
} else {
|
||||
this.channelfocus?.readbottom();
|
||||
this.channelfocus?.goToBottom();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user