misc: remove avatar for NSFW community links
This commit is contained in:
3 files changed
+38
-53
No files matched your search
@@ -5,8 +5,8 @@ import type { SortType } from 'lemmy-js-client'
|
||||
|
||||
export async function load({ params, url, fetch }) {
|
||||
const page = Number(url.searchParams.get('page')) || 1
|
||||
const type: 'comments' | 'posts' | 'all' =
|
||||
(url.searchParams.get('type') as 'comments' | 'posts' | 'all') || 'all'
|
||||
const type: 'comments' | 'posts' =
|
||||
(url.searchParams.get('type') as 'comments' | 'posts') || 'posts'
|
||||
const sort: SortType = (url.searchParams.get('sort') as SortType) || 'New'
|
||||
|
||||
const user = await getClient(undefined, fetch).getPersonDetails({
|
||||
@@ -18,28 +18,14 @@ export async function load({ params, url, fetch }) {
|
||||
|
||||
const items = [...user.posts, ...user.comments]
|
||||
|
||||
if (sort == 'TopAll') {
|
||||
items.sort(
|
||||
(a, b) =>
|
||||
b.counts.upvotes -
|
||||
b.counts.downvotes -
|
||||
(a.counts.upvotes - a.counts.downvotes),
|
||||
)
|
||||
} else if (sort == 'New') {
|
||||
items.sort(
|
||||
(a, b) =>
|
||||
Date.parse(getItemPublished(b)) - Date.parse(getItemPublished(a)),
|
||||
)
|
||||
}
|
||||
|
||||
return {
|
||||
filters: new ReactiveState({
|
||||
type: type,
|
||||
page: page,
|
||||
sort: sort,
|
||||
}),
|
||||
person_view: user.person_view,
|
||||
moderates: user.moderates,
|
||||
person_view: new ReactiveState(user.person_view),
|
||||
moderates: new ReactiveState(user.moderates),
|
||||
items: new ReactiveState(items),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user