fixes
This commit is contained in:
parent
155aa524f3
commit
244f7e40ce
2 changed files with 6 additions and 4 deletions
|
|
@ -28,8 +28,8 @@ let { user } : {user: UserEntry} = $props();
|
||||||
{#if user}
|
{#if user}
|
||||||
<li>
|
<li>
|
||||||
<div class="header-username nomobile">
|
<div class="header-username nomobile">
|
||||||
<span>@{user.username}</span>
|
<span><a href="/@{user.username}">@{user.username}</a></span>
|
||||||
<span>{0} karma</span>
|
<span>{user.karma || 0} karma</span>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="/logout" aria-label="Log out" title="Log out"><RiLogoutBoxLine /></a></li>
|
<li><a href="/logout" aria-label="Log out" title="Log out"><RiLogoutBoxLine /></a></li>
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,10 @@ import type { LoadEvent } from '@sveltejs/kit';
|
||||||
async function loadFeed (event: LoadEvent): Promise<PostEntry[] | null> {
|
async function loadFeed (event: LoadEvent): Promise<PostEntry[] | null> {
|
||||||
const resp = await backend.withEvent(event).fetch('home/feed');
|
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 {
|
try {
|
||||||
const respJ = await resp.json();
|
const respJ = await resp.json();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue