ssb: Paranoia around trying to avoid showing stale/irrelevant messages. Need to rethink this approach entirely sometime.
This commit is contained in:
@@ -403,11 +403,11 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
let self = this;
|
||||
this.loading++;
|
||||
let messages = [];
|
||||
let original_hash = this.hash;
|
||||
let original_key = JSON.stringify([this.hash, this.channels_latest ?? {}]);
|
||||
try {
|
||||
if (this._messages_hash !== this.hash) {
|
||||
if (this._messages_key !== original_key) {
|
||||
this.messages = [];
|
||||
this._messages_hash = this.hash;
|
||||
this._messages_key = original_key;
|
||||
}
|
||||
this._messages_following = JSON.stringify(this.following);
|
||||
this._private_messages = JSON.stringify([
|
||||
@@ -429,7 +429,8 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
} finally {
|
||||
this.loading--;
|
||||
}
|
||||
if (this.hash == original_hash) {
|
||||
let current_key = JSON.stringify([this.hash, this.channels_latest ?? {}]);
|
||||
if (current_key === original_key) {
|
||||
this.messages = this.merge_messages(this.messages, messages);
|
||||
}
|
||||
this.time_loading = undefined;
|
||||
@@ -485,7 +486,8 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
render() {
|
||||
if (
|
||||
!this.messages ||
|
||||
this._messages_hash !== this.hash ||
|
||||
this._messages_key !==
|
||||
JSON.stringify([this.hash, this.channels_latest ?? {}]) ||
|
||||
this._messages_following !== JSON.stringify(this.following) ||
|
||||
this._private_messages !==
|
||||
JSON.stringify([
|
||||
|
||||
Reference in New Issue
Block a user