(pathname: string)
| 36 | } |
| 37 | |
| 38 | export function mapMemoryPathToBrowserPath(pathname: string) { |
| 39 | if (pathname === "/") { |
| 40 | return { path: "/", titleChange: "Codex" }; |
| 41 | } |
| 42 | |
| 43 | const match = pathname.match(/^\/local\/([^/?#]+)$/); |
| 44 | if (!match) { |
| 45 | return null; |
| 46 | } |
| 47 | |
| 48 | return { path: `/thread/${encodeURIComponent(match[1])}` }; |
| 49 | } |
| 50 | |
| 51 | export function dispatchNavigateToRoute(path: string): void { |
| 52 | window.dispatchEvent( |