diff --git a/web/src/lib/routes.ts b/web/src/lib/routes.ts index e62eedd..c51b687 100644 --- a/web/src/lib/routes.ts +++ b/web/src/lib/routes.ts @@ -128,7 +128,11 @@ function asWindow(segment: string | undefined): WindowName | null { // A link from before the rename. Resolved here rather than rejected, so an // address somebody shared still opens the page it named — `href` will then // write the block count back into the bar. - return (segment && LEGACY_WINDOWS[segment]) ?? null + // + // The empty segment is checked separately rather than leaning on `&&`: that + // form returns `''` for an empty path, which is neither a window nor null. + if (!segment) return null + return LEGACY_WINDOWS[segment] ?? null } /**