evOo-local/apps/web/src/lib/bootstrap-target.ts
cynarAI 6c7eed7580 Initial clean evOo-local from f00577b
Fresh history cut from cynarAI/evoo antigravity-handoff/project-timeline
(Voice First + project timeline). Brand docs/titles as evOo; keep @rakazo/*
packages as tech debt. Excludes node_modules, caches, secrets, voice blobs.
2026-09-20 17:15:16 +02:00

18 lines
565 B
TypeScript

export function initialBootstrapTarget(pathname: string, desktop: boolean) {
const appRoute = pathname === "/app" || pathname.startsWith("/app/");
if (!appRoute && !(desktop && pathname === "/")) return null;
return { botId: appRoute ? botIdFromPath(pathname) : undefined };
}
function botIdFromPath(pathname: string) {
const segments = pathname.split("/");
if (segments[2] === "g") return undefined;
const encoded = segments[2];
if (!encoded) return undefined;
try {
return decodeURIComponent(encoded);
} catch {
return undefined;
}
}