From e9bad39a7ed224efefe2d21a35a7d27cd25e0879 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Fri, 30 May 2025 14:40:53 -0400 Subject: sync --- app/packages/web/src/components/Share.tsx | 13 ++++--------- app/packages/web/src/pages/s/index.astro | 28 ++++++++++++++++++++++++++++ app/packages/web/src/pages/share/index.astro | 28 ---------------------------- 3 files changed, 32 insertions(+), 37 deletions(-) create mode 100644 app/packages/web/src/pages/s/index.astro delete mode 100644 app/packages/web/src/pages/share/index.astro (limited to 'app/packages/web/src') diff --git a/app/packages/web/src/components/Share.tsx b/app/packages/web/src/components/Share.tsx index db533831d..ac75a3cf7 100644 --- a/app/packages/web/src/components/Share.tsx +++ b/app/packages/web/src/components/Share.tsx @@ -26,7 +26,6 @@ import { IconPencilSquare, IconWrenchScrewdriver, } from "./icons" -import CodeBlock from "./CodeBlock" import DiffView from "./DiffView" import styles from "./share.module.css" import { type UIMessage } from "ai" @@ -219,7 +218,7 @@ function PartFooter(props: { time: number }) { export default function Share(props: { api: string }) { let params = new URLSearchParams(document.location.search) - const sessionId = params.get("id") + const id = params.get("id") const [store, setStore] = createStore<{ info?: SessionInfo @@ -233,12 +232,8 @@ export default function Share(props: { api: string }) { onMount(() => { const apiUrl = props.api - console.log("Mounting Share component with ID:", sessionId) - console.log("API URL:", apiUrl) - - if (!sessionId) { - console.error("Session ID not found in environment variables") - setConnectionStatus(["error", "Session ID not found"]) + if (!id) { + setConnectionStatus(["error", "id not found"]) return } @@ -262,7 +257,7 @@ export default function Share(props: { api: string }) { // Always use secure WebSocket protocol (wss) const wsBaseUrl = apiUrl.replace(/^https?:\/\//, "wss://") - const wsUrl = `${wsBaseUrl}/share_poll?id=${sessionId}` + const wsUrl = `${wsBaseUrl}/share_poll?id=${id}` console.log("Connecting to WebSocket URL:", wsUrl) // Create WebSocket connection diff --git a/app/packages/web/src/pages/s/index.astro b/app/packages/web/src/pages/s/index.astro new file mode 100644 index 000000000..b678c0db9 --- /dev/null +++ b/app/packages/web/src/pages/s/index.astro @@ -0,0 +1,28 @@ +--- +import config from "virtual:starlight/user-config"; + +import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro'; +import Share from "../../components/Share.tsx"; + +--- + + + + + + diff --git a/app/packages/web/src/pages/share/index.astro b/app/packages/web/src/pages/share/index.astro deleted file mode 100644 index b678c0db9..000000000 --- a/app/packages/web/src/pages/share/index.astro +++ /dev/null @@ -1,28 +0,0 @@ ---- -import config from "virtual:starlight/user-config"; - -import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro'; -import Share from "../../components/Share.tsx"; - ---- - - - - - - -- cgit v1.2.3