diff --git a/apps/ssb.json b/apps/ssb.json index 28f31422e..9d2c88758 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🦀", - "previous": "&N69/NfCoe/HmdG5Hl/ulq/CDYLhDYzi50jbg2h3VPuc=.sha256" + "previous": "&ywgXrIlVu5chLPseAwTXdpzaxGep+rjs1ZPeV4tj3wM=.sha256" } diff --git a/apps/ssb/tf-tab-news.js b/apps/ssb/tf-tab-news.js index d404eb7c7..ecf8b12d7 100644 --- a/apps/ssb/tf-tab-news.js +++ b/apps/ssb/tf-tab-news.js @@ -128,6 +128,23 @@ class TfTabNewsElement extends LitElement { return this.hash.startsWith('##') ? this.hash.substring(2) : undefined; } + compare_follows(a, b) { + return a[1].followed - b[1].followed; + } + + suggested_follows() { + let self = this; + return Object.entries(this.users).filter( + (x) => (x[1].follow_depth > 1) + ).sort( + self.compare_follows + ).slice( + 0, 8 + ).map( + (x) => (x[0]) + ); + } + render_sidebar() { return html`
` : undefined} -
Channels
+

Channels

Connections
+

Connections

${this.connections.map( (x) => html` ` )} +

Suggested Follows

+ ${this.suggested_follows().map( + (x) => html` + + ` + )}