fixes following type
This commit is contained in:
@@ -7,6 +7,9 @@
|
||||
|
||||
let loading: boolean = false;
|
||||
|
||||
const key: "follower" | "followee" =
|
||||
$page.params.type == "following" ? "followee" : "follower";
|
||||
|
||||
$: pagination = {
|
||||
page: data.follows.page,
|
||||
totalPages: data.follows.totalPages,
|
||||
@@ -39,22 +42,22 @@
|
||||
<h1 class="text-3xl font-semibold mb-4">{$_($page.params.type)}</h1>
|
||||
<ul class="space-y-4">
|
||||
{#each data.follows.items as follow}
|
||||
{#if !follow.expand?.follower.private}
|
||||
<a href="/profile/{follow.expand?.follower.id}">
|
||||
{#if !follow.expand?.[key].private}
|
||||
<a href="/profile/{follow.expand?.[key].id}">
|
||||
<li
|
||||
class="flex items-center gap-x-4 hover:bg-menu-item-background-hover p-4"
|
||||
>
|
||||
<img
|
||||
class="rounded-full w-10 aspect-square overflow-hidden"
|
||||
src={getFileURL(
|
||||
follow.expand?.follower ?? {},
|
||||
follow.expand?.follower.avatar,
|
||||
follow.expand?.[key] ?? {},
|
||||
follow.expand?.[key].avatar,
|
||||
) ||
|
||||
`https://api.dicebear.com/7.x/initials/svg?seed=${data.user.username}&backgroundType=gradientLinear`}
|
||||
alt="avatar"
|
||||
/>
|
||||
<p class="text-lg font-medium">
|
||||
{follow.expand?.follower.username}
|
||||
{follow.expand?.[key].username}
|
||||
</p>
|
||||
</li>
|
||||
</a>
|
||||
@@ -65,14 +68,14 @@
|
||||
<img
|
||||
class="rounded-full w-10 aspect-square overflow-hidden"
|
||||
src={getFileURL(
|
||||
follow.expand?.follower ?? {},
|
||||
follow.expand?.follower.avatar,
|
||||
follow.expand?.[key] ?? {},
|
||||
follow.expand?.[key].avatar,
|
||||
) ||
|
||||
`https://api.dicebear.com/7.x/initials/svg?seed=${data.user.username}&backgroundType=gradientLinear`}
|
||||
alt="avatar"
|
||||
/>
|
||||
<p class="text-lg font-medium">
|
||||
{follow.expand?.follower.username}
|
||||
{follow.expand?.[key].username}
|
||||
</p>
|
||||
</li>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user