This commit is contained in:
Yusur 2025-09-14 16:05:35 +02:00
parent 155aa524f3
commit 244f7e40ce
2 changed files with 6 additions and 4 deletions

View file

@ -28,8 +28,8 @@ let { user } : {user: UserEntry} = $props();
{#if user}
<li>
<div class="header-username nomobile">
<span>@{user.username}</span>
<span>{0} karma</span>
<span><a href="/@{user.username}">@{user.username}</a></span>
<span>{user.karma || 0} karma</span>
</div>
</li>
<li><a href="/logout" aria-label="Log out" title="Log out"><RiLogoutBoxLine /></a></li>

View file

@ -6,8 +6,10 @@ import type { LoadEvent } from '@sveltejs/kit';
async function loadFeed (event: LoadEvent): Promise<PostEntry[] | null> {
const resp = await backend.withEvent(event).fetch('home/feed');
if ([200].indexOf(resp.status) < 0) return null;
if ([200].indexOf(resp.status) < 0) {
console.error(`fetch feed returned status ${resp.status}`);
return null;
}
try {
const respJ = await resp.json();