ssb: Tried to do the right lit things to prevent unnecessary re-rendering. Ended up doing a lazy JSON thing.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 26m48s

This commit is contained in:
2025-01-11 14:09:42 -05:00
parent 02759c6f83
commit aa15da50ab
5 changed files with 17 additions and 12 deletions

View File

@ -1,4 +1,4 @@
import {LitElement, html, unsafeHTML, until} from './lit-all.min.js';
import {LitElement, cache, html, unsafeHTML, until} from './lit-all.min.js';
import * as tfrpc from '/static/tfrpc.js';
import {styles} from './tf-styles.js';
@ -373,7 +373,8 @@ class TfTabNewsFeedElement extends LitElement {
if (
!this.messages ||
this._messages_hash !== this.hash ||
this._messages_following !== this.following
JSON.stringify(this._messages_following) !==
JSON.stringify(this.following)
) {
console.log(
`loading messages for ${this.whoami} (following ${this.following.length})`
@ -417,7 +418,7 @@ class TfTabNewsFeedElement extends LitElement {
</p>
`;
}
return html`
return cache(html`
<button class="w3-button w3-theme-d1" @click=${this.mark_all_read}>
Mark All Read
</button>
@ -433,7 +434,7 @@ class TfTabNewsFeedElement extends LitElement {
channel_unread=${this.channels_unread?.[this.channel()]}
></tf-news>
${more}
`;
`);
}
}