ssb: Show the number of accounts followed on the profile show/hide followed button.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 31m51s

This commit is contained in:
2025-07-09 17:50:06 -04:00
parent e26af21f63
commit 2f893494b0
2 changed files with 7 additions and 9 deletions

View File

@ -1,5 +1,5 @@
{ {
"type": "tildefriends-app", "type": "tildefriends-app",
"emoji": "🦀", "emoji": "🦀",
"previous": "&lX0ik2WzwWTPa2xkziPbyRZJHP9far9epKqdVIIqFM8=.sha256" "previous": "&bfTIcHq6RtCC3tRZhVpQ0obywbMBjABT2Mk02NLGZGk=.sha256"
} }

View File

@ -14,6 +14,7 @@ class TfProfileElement extends LitElement {
sequence: {type: Number}, sequence: {type: Number},
following: {type: Boolean}, following: {type: Boolean},
blocking: {type: Boolean}, blocking: {type: Boolean},
show_followed: {type: Boolean},
}; };
} }
@ -202,11 +203,7 @@ class TfProfileElement extends LitElement {
toggle_account_list(event) { toggle_account_list(event) {
let content = event.srcElement.nextElementSibling; let content = event.srcElement.nextElementSibling;
if (content.classList.toggle('w3-hide')) { this.show_followed = !this.show_followed;
event.srcElement.innerText = 'Show Followed Accounts';
} else {
event.srcElement.innerText = 'Hide Followed Accounts';
}
} }
async load_follows() { async load_follows() {
@ -214,12 +211,13 @@ class TfProfileElement extends LitElement {
return html` return html`
<div class="w3-container"> <div class="w3-container">
<button <button
class="w3-button w3-block w3-theme-d1" class="w3-button w3-block w3-theme-d1 followed_accounts"
@click=${this.toggle_account_list} @click=${this.toggle_account_list}
> >
Show Followed Accounts ${this.show_followed ? 'Hide' : 'Show'} Followed Accounts
(${Object.keys(accounts).length})
</button> </button>
<div class="w3-hide w3-card"> <div class=${'w3-card' + (this.show_followed ? '' : ' w3-hide')}>
<ul class="w3-ul w3-theme-d4 w3-border-theme"> <ul class="w3-ul w3-theme-d4 w3-border-theme">
${Object.keys(accounts).map( ${Object.keys(accounts).map(
(x) => html` (x) => html`