diff options
| author | Jay V <[email protected]> | 2025-06-10 11:52:02 -0500 |
|---|---|---|
| committer | Jay V <[email protected]> | 2025-06-10 11:52:02 -0500 |
| commit | 0e58f488df63f2143fdc5efa9ea85b1751bf7c10 (patch) | |
| tree | b5cbbce129948e96987910d6132ea541c8e9da86 /packages/web/src | |
| parent | fa7416687bfe67d47b187c5b9c0dc8a5d2a95781 (diff) | |
| download | opencode-0e58f488df63f2143fdc5efa9ea85b1751bf7c10.tar.gz opencode-0e58f488df63f2143fdc5efa9ea85b1751bf7c10.zip | |
moving share urls
Diffstat (limited to 'packages/web/src')
| -rw-r--r-- | packages/web/src/components/Share.tsx | 4 | ||||
| -rw-r--r-- | packages/web/src/pages/s/[id].astro (renamed from packages/web/src/pages/s/index.astro) | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/packages/web/src/components/Share.tsx b/packages/web/src/components/Share.tsx index 16abe9668..9e057ee66 100644 --- a/packages/web/src/components/Share.tsx +++ b/packages/web/src/components/Share.tsx @@ -425,12 +425,14 @@ function ToolFooter(props: { time: number }) { } export default function Share(props: { + id: string api: string info: SessionInfo messages: Record<string, SessionMessage> }) { + const id = props.id + let params = new URLSearchParams(document.location.search) - const id = params.get("id") const [store, setStore] = createStore<{ info?: SessionInfo diff --git a/packages/web/src/pages/s/index.astro b/packages/web/src/pages/s/[id].astro index a6b74ecde..523fa7e6c 100644 --- a/packages/web/src/pages/s/index.astro +++ b/packages/web/src/pages/s/[id].astro @@ -6,7 +6,7 @@ import Share from "../../components/Share.tsx"; const apiUrl = import.meta.env.VITE_API_URL; -const id = Astro.url.searchParams.get('id') +const { id } = Astro.params; const res = await fetch(`${apiUrl}/share_data?id=${id}`); const data = await res.json(); @@ -39,7 +39,13 @@ const ogImage = data.ogImage; ], }} > - <Share api={apiUrl} info={data.info} messages={data.messages} client:only="solid" /> + <Share + id={id} + api={apiUrl} + info={data.info} + messages={data.messages} + client:only="solid" + /> </StarlightPage> <style is:global> |
