Skip to content

Commit 72f6168

Browse files
committed
Add folder param to Cloudflare preview URL
1 parent d552642 commit 72f6168

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

apps/web/src/pages/sandbox/Sandbox.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,17 @@ function New() {
131131

132132
const response = await exposeVscode(data!.sandbox!.id!);
133133
if (response.data?.previewUrl) {
134-
window.open(response.data.previewUrl, "_blank");
134+
const url = new URL(response.data.previewUrl);
135+
if (
136+
data.sandbox?.repo &&
137+
data.sandbox.provider === "cloudflare"
138+
) {
139+
url.searchParams.set(
140+
"folder",
141+
`/workspace/${data.sandbox.repo.split("/").pop()!}`,
142+
);
143+
}
144+
window.open(url, "_blank");
135145
}
136146
}}
137147
>

0 commit comments

Comments
 (0)