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.
18 lines
565 B
TypeScript
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;
|
|
}
|
|
}
|