ssb: Don't show messages that were slow to load from another channel.
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled

This commit is contained in:
2025-08-20 19:38:52 -04:00
parent 61501a9b64
commit 77b1ea1fc8
2 changed files with 5 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
{ {
"type": "tildefriends-app", "type": "tildefriends-app",
"emoji": "🦀", "emoji": "🦀",
"previous": "&UEIA5OmcpNMsBGeyxmgTdib+tkpPgr62iXdTlt1aH9U=.sha256" "previous": "&zJ76A1+RyfQ6zpNhfdvjWOLGt+cAwGaB4ZqEx4e2PNk=.sha256"
} }

View File

@@ -386,6 +386,7 @@ class TfTabNewsFeedElement extends LitElement {
let self = this; let self = this;
this.loading++; this.loading++;
let messages = []; let messages = [];
let original_hash = this.hash;
try { try {
if (this._messages_hash !== this.hash) { if (this._messages_hash !== this.hash) {
this.messages = []; this.messages = [];
@@ -407,7 +408,9 @@ class TfTabNewsFeedElement extends LitElement {
} finally { } finally {
this.loading--; this.loading--;
} }
this.messages = this.merge_messages(this.messages, messages); if (this.hash == original_hash) {
this.messages = this.merge_messages(this.messages, messages);
}
this.time_loading = undefined; this.time_loading = undefined;
console.log( console.log(
`loading ${messages.length} messages done for ${self.whoami} in ${(new Date() - start_time) / 1000}s` `loading ${messages.length} messages done for ${self.whoami} in ${(new Date() - start_time) / 1000}s`