Files
archie/ui/src/legacy-hash-redirect.ts
T
sam e2e6dd0b26 feat(webui): history routing
createWebHistory with base "/". The Go server already falls back to index.html
for any unmatched path and [web] has no path-prefix option, so the dashboard is
always at the root.

legacy-hash-redirect.ts rewrites `#/path` links minted before this change.
Verified against archie-ui rather than the Vite dev server: /tasks, /tasks/42
and /settings all serve index.html with assets resolving, and #/settings lands
on /settings.
2026-09-20 18:14:37 +10:00

8 lines
221 B
TypeScript

// Rewrites a legacy `#/path` URL to `/path`.
const legacy = window.location.hash;
if (legacy.startsWith("#/")) {
const path = legacy.slice(1);
window.history.replaceState(null, "", path + window.location.search);
}