ssb: Slight suggested follows cleanup.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 31m26s
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 31m26s
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"type": "tildefriends-app",
|
||||
"emoji": "🦀",
|
||||
"previous": "&ZrdjhiNgjE8U8nlHezw+Hiry43VaNO5i0OAr3ncVVkE=.sha256"
|
||||
"previous": "&DGtlnm5wWRZCgJMF8JsP6VtzNRrd4KLoERJRpFULqOY=.sha256"
|
||||
}
|
||||
|
@@ -156,11 +156,8 @@ class TfTabNewsElement extends LitElement {
|
||||
return this.hash.startsWith('##') ? this.hash.substring(2) : undefined;
|
||||
}
|
||||
|
||||
compare_follows() {
|
||||
const now = new Date().valueOf();
|
||||
return function (a, b) {
|
||||
return (b[1].ts > now ? -1 : b[1].ts) - (a[1].ts > now ? -1 : a[1].ts);
|
||||
};
|
||||
compare_follows(a, b) {
|
||||
return b[1].ts > a[1].ts ? 1 : b[1].ts < a[1].ts ? -1 : 0;
|
||||
}
|
||||
|
||||
suggested_follows() {
|
||||
@@ -169,9 +166,11 @@ class TfTabNewsElement extends LitElement {
|
||||
** pinned at the top.
|
||||
*/
|
||||
let self = this;
|
||||
let now = new Date().valueOf();
|
||||
return Object.entries(this.users)
|
||||
.filter((x) => x[1].ts < now)
|
||||
.filter((x) => x[1].follow_depth > 1)
|
||||
.sort(self.compare_follows())
|
||||
.sort(self.compare_follows)
|
||||
.slice(0, 8)
|
||||
.map((x) => x[0]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user