mirror of
https://github.com/MathMan05/Fermi.git
synced 2026-07-28 07:49:23 +00:00
more unread changes
This commit is contained in:
@@ -2890,6 +2890,10 @@ class Channel extends SnowFlake {
|
||||
}
|
||||
this.setLastMessageId(messagez.id);
|
||||
|
||||
if (this.infinite.atBottom()) {
|
||||
this.lastreadmessageid = messagez.id;
|
||||
}
|
||||
|
||||
this.unreads();
|
||||
this.guild.unreads();
|
||||
if (this === this.localuser.channelfocus) {
|
||||
@@ -2902,9 +2906,6 @@ class Channel extends SnowFlake {
|
||||
if (messagez.author === this.localuser.user) {
|
||||
this.lastSentMessage = messagez;
|
||||
this.slowmode();
|
||||
this.lastreadmessageid = messagez.id;
|
||||
this.lastmessage = messagez;
|
||||
this.lastreadmessageid = messagez.id;
|
||||
this.mentions = 0;
|
||||
this.unreads();
|
||||
this.guild.unreads();
|
||||
|
||||
@@ -183,20 +183,23 @@ class InfiniteScroller {
|
||||
snap();
|
||||
}
|
||||
|
||||
snapBottom(): () => void {
|
||||
const nothing = () => {};
|
||||
atBottom() {
|
||||
const scroll = this.scroller;
|
||||
if (!scroll) return nothing;
|
||||
if (!scroll) return false;
|
||||
const last = this.weakElmId.get(Array.from(scroll.children).at(-1) as HTMLElement);
|
||||
if (!last) return nothing;
|
||||
if (this.backElm.get(last) || !this.backElm.has(last)) return nothing;
|
||||
if (this.div) {
|
||||
if (!last) return false;
|
||||
if (this.backElm.get(last) || !this.backElm.has(last)) return false;
|
||||
return this.scrollBottom < 4;
|
||||
}
|
||||
|
||||
snapBottom(): () => void {
|
||||
if (this.div && this.atBottom()) {
|
||||
const trigger = this.scrollBottom < 4;
|
||||
return () => {
|
||||
if (this.div && trigger) this.div.scrollTop = this.div.scrollHeight;
|
||||
};
|
||||
} else {
|
||||
return nothing;
|
||||
return () => {};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user