From 4e15c6671e0c97cf490832ca66a868562e906d70 Mon Sep 17 00:00:00 2001 From: Scooter Date: Mon, 20 Jan 2025 13:41:41 -0500 Subject: [PATCH 1/3] Remove the ability to ship local files as a demo Doesn't let a user ship a project if they try to submit a local file instead of a video or deployment link. --- src/app/harbor/shipyard/new-ship-form.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app/harbor/shipyard/new-ship-form.tsx b/src/app/harbor/shipyard/new-ship-form.tsx index ff02e041..bbb4f0a7 100644 --- a/src/app/harbor/shipyard/new-ship-form.tsx +++ b/src/app/harbor/shipyard/new-ship-form.tsx @@ -165,6 +165,15 @@ export default function NewShipForm({ return } + if (deploymentUrl.startsWith('file://')) { + toast({ + title: "Local file URLs aren't allowed", + description: 'You cannot use a local file as a demo. Try using #cdn instead to host a video or vercel for a deployed project!', + }) + setStaging(false) + return + } + const repoUrl = formData.get('repo_url') as string if (usedRepos.includes(repoUrl)) { toast({ From 9503c95dd4c9dfd8321674cc4165d40b3158c249 Mon Sep 17 00:00:00 2001 From: Scooter Date: Mon, 20 Jan 2025 13:44:10 -0500 Subject: [PATCH 2/3] Trying to fix the fomatting Signed-off-by: Scooter --- src/app/harbor/shipyard/new-ship-form.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/harbor/shipyard/new-ship-form.tsx b/src/app/harbor/shipyard/new-ship-form.tsx index bbb4f0a7..b81021e6 100644 --- a/src/app/harbor/shipyard/new-ship-form.tsx +++ b/src/app/harbor/shipyard/new-ship-form.tsx @@ -168,7 +168,8 @@ export default function NewShipForm({ if (deploymentUrl.startsWith('file://')) { toast({ title: "Local file URLs aren't allowed", - description: 'You cannot use a local file as a demo. Try using #cdn instead to host a video or vercel for a deployed project!', + description: + "You cannot use a local file as a demo. Try using #cdn instead to host a video or vercel for a deployed project!", }) setStaging(false) return From 28458b8483225d8c267bd50a6a3ce543dbc327cd Mon Sep 17 00:00:00 2001 From: Scooter Date: Mon, 20 Jan 2025 13:56:49 -0500 Subject: [PATCH 3/3] Actually ran prettier now --- src/app/harbor/shipyard/new-ship-form.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/harbor/shipyard/new-ship-form.tsx b/src/app/harbor/shipyard/new-ship-form.tsx index b81021e6..10ac2b55 100644 --- a/src/app/harbor/shipyard/new-ship-form.tsx +++ b/src/app/harbor/shipyard/new-ship-form.tsx @@ -168,8 +168,8 @@ export default function NewShipForm({ if (deploymentUrl.startsWith('file://')) { toast({ title: "Local file URLs aren't allowed", - description: - "You cannot use a local file as a demo. Try using #cdn instead to host a video or vercel for a deployed project!", + description: + 'You cannot use a local file as a demo. Try using #cdn instead to host a video or vercel for a deployed project!', }) setStaging(false) return