cleanup + fix feed

This commit is contained in:
Yusur 2025-09-17 14:00:59 +02:00
parent 244f7e40ce
commit a13c7cbc22
5 changed files with 18 additions and 14 deletions

View file

@ -6,7 +6,7 @@
let { user } : {user: UserEntry} = $props();
let enable_search = $state(false);
</script>
@ -14,6 +14,7 @@ let { user } : {user: UserEntry} = $props();
<div class="metanav">
<ul>
<li>
{#if enable_search}
<form action="/search"
method="POST"
class="mini-search-bar nomobile">
@ -24,6 +25,9 @@ let { user } : {user: UserEntry} = $props();
<a href="/search" aria-label="Search" title="Search" class="mobileonly">
<RiSearchLine />
</a>
{:else}
<div style="flex:1"></div>
{/if}
</li>
{#if user}
<li>

View file

@ -48,8 +48,7 @@ export class Backend {
}
async fetch(url: string, options?: RequestInit) {
console.info(`fetch ${Backend.ENDPOINT_BASE}/${encodeURIComponent(url)}`)
return await fetch(`${Backend.ENDPOINT_BASE}/${encodeURIComponent(url)}`, options);
return await fetch(`${Backend.ENDPOINT_BASE}/${url.replace(/^\/+/, '')}`, options);
}
withEvent(event: any) {
@ -76,6 +75,7 @@ class EventBackend extends Backend {
}
async fetch(url: string, options?: RequestInit): Promise<Response> {
console.debug(`fetch ${Backend.ENDPOINT_BASE}/${url.replace(/^\/+/, '')}`);
return await this.event.fetch(`${Backend.ENDPOINT_BASE}/${url.replace(/^\/+/, '')}`, options);
}
}