ssb: Show/hide "Mark All Read" and the unread line more correctly.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 32m53s

This commit is contained in:
2025-06-11 19:22:21 -04:00
parent cbf1273a55
commit 2a6789063e
3 changed files with 22 additions and 8 deletions

View File

@ -275,6 +275,10 @@ class TfTabNewsFeedElement extends LitElement {
];
}
unread_allowed() {
return !this.hash.startsWith('#%') && !this.hash.startsWith('#@');
}
async load_more() {
this.loading++;
this.loading_canceled = false;
@ -424,9 +428,11 @@ class TfTabNewsFeedElement extends LitElement {
if (!this.hash.startsWith('#%')) {
more = html`
<p>
<button class="w3-button w3-theme-d1" @click=${this.mark_all_read}>
Mark All Read
</button>
${this.unread_allowed() ? html`
<button class="w3-button w3-theme-d1" @click=${this.mark_all_read}>
Mark All Read
</button>
` : undefined}
<button
?disabled=${this.loading}
class="w3-button w3-theme-d1"
@ -458,7 +464,7 @@ class TfTabNewsFeedElement extends LitElement {
`;
}
return cache(html`
${!this.hash.startsWith('#%')
${this.unread_allowed()
? html`<button
class="w3-button w3-theme-d1"
@click=${this.mark_all_read}
@ -474,6 +480,7 @@ class TfTabNewsFeedElement extends LitElement {
.following=${this.following}
.drafts=${this.drafts}
.expanded=${this.expanded}
hash=${this.hash}
channel=${this.channel()}
channel_unread=${this.channels_unread?.[this.channel()]}
.recent_reactions=${this.recent_reactions}