vinterliste/frontend
Ole-Morten Duesund 443702d222 fix(spa): back button respects history; auto-redirect / → /hjem when logged in
Two related navigation fixes:

1. Back-button now uses real browser history. Sub-view "Tilbake"
   buttons (permalink, tag page, personvern, public list) all used
   to call goPublicHome() — which always sent the user to / —
   instead of returning to wherever they came from. Replaced with
   a single backToCallerOrHome() that delegates to
   navigate.goBack(fallback), which calls window.history.back() if
   there's a prior entry, else navigates to /hjem (or / when
   anonymous) so cold-loaded permalinks still have somewhere to go.

2. Cold-load redirect: a logged-in user landing on / probably
   wants their own dashboard, not the public marketing surface.
   After the me-probe finishes in onMount, if the initial route
   was 'public-home' and session.user exists, push to /hjem
   instead of applying the public-home route. This only runs on
   initial mount (not on every popstate), so browser-back from
   /hjem to / still works if the user explicitly navigates there.

The wordmark in the nav also picks its destination by auth state
now — logged-in users go to /hjem, anonymous users to /. Otherwise
clicking it post-redirect would just bounce back to /hjem.
2026-05-25 18:48:34 +02:00
..
public Design refresh: warmer palette, softer cards, badge icons, hero treatment 2026-05-25 15:47:39 +02:00
src fix(spa): back button respects history; auto-redirect / → /hjem when logged in 2026-05-25 18:48:34 +02:00
index.html Design refresh: warmer palette, softer cards, badge icons, hero treatment 2026-05-25 15:47:39 +02:00
svelte.config.js Scaffold Vinterliste — end-to-end encrypted winter activity list 2026-05-25 12:27:14 +02:00
tsconfig.json Public landing, owner-list links, owner-conditional semi, PWA + mobile 2026-05-25 12:57:59 +02:00
vite.config.ts Scaffold Vinterliste — end-to-end encrypted winter activity list 2026-05-25 12:27:14 +02:00