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:
parent
10bdf603a9
commit
a57ae1e8bf
|
|
@ -71,8 +71,9 @@ export const load: PageLoad = async ({ url }) => {
|
|||
|
||||
if (!browser) {
|
||||
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')
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue