refactor(spa): detail-route 404 statt runtime-fallback

Slugs ausserhalb des snapshots werfen jetzt 404 (server-side beim
build, browser-side via static-fallback). Vorher kam in dem fall
{ dtag, snapshot: null } zurueck — die svelte-seite versuchte dann
clientseitig via loadPost() zu laden.

Frische nostr-first-posts erscheinen ab jetzt erst nach dem
naechsten snapshot+build-lauf, nicht mehr live aus den relays.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jörg Lohrer 2026-04-28 09:05:31 +02:00
parent 10bdf603a9
commit a57ae1e8bf
1 changed files with 3 additions and 2 deletions

View File

@ -71,8 +71,9 @@ export const load: PageLoad = async ({ url }) => {
if (!browser) { if (!browser) {
const snapshot = await readPost(dtag) const snapshot = await readPost(dtag)
if (snapshot) return { dtag, snapshot } if (!snapshot) throw error(404, 'Post nicht gefunden')
return { dtag, snapshot }
} }
return { dtag, snapshot: null } throw error(404, 'Post nicht gefunden')
} }