From dd0f105c87dedd6a345342711c460ae94da2764f Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 9 Dec 2025 19:58:18 -0600 Subject: [PATCH] Preserve subdomain in Shakespeare Deploy --- src/components/DeployDialog.tsx | 3 +++ src/components/deploy/ShakespeareDeployForm.tsx | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/DeployDialog.tsx b/src/components/DeployDialog.tsx index 8c8dbd88..09b134ae 100644 --- a/src/components/DeployDialog.tsx +++ b/src/components/DeployDialog.tsx @@ -404,11 +404,14 @@ export function DeployDialog({ projectId, projectName, open, onOpenChange }: Dep if (selectedProvider.type === 'shakespeare') { const shakespeareProvider = selectedProvider as ShakespeareDeployProvider; + const savedConfig = projectSettings.providers[selectedProviderId]; + const savedSubdomain = savedConfig?.type === 'shakespeare' ? savedConfig.data.subdomain : undefined; return ( diff --git a/src/components/deploy/ShakespeareDeployForm.tsx b/src/components/deploy/ShakespeareDeployForm.tsx index 0fad1261..3f167b87 100644 --- a/src/components/deploy/ShakespeareDeployForm.tsx +++ b/src/components/deploy/ShakespeareDeployForm.tsx @@ -6,6 +6,7 @@ import { AlertCircle } from 'lucide-react'; interface ShakespeareDeployFormProps { host?: string; projectId: string; + savedSubdomain?: string; onSubdomainChange: (subdomain: string) => void; onValidationChange?: (isValid: boolean) => void; } @@ -13,10 +14,16 @@ interface ShakespeareDeployFormProps { export function ShakespeareDeployForm({ host = 'shakespeare.wtf', projectId, + savedSubdomain, onSubdomainChange, onValidationChange, }: ShakespeareDeployFormProps) { - const [subdomain, setSubdomain] = useState(projectId); + const [subdomain, setSubdomain] = useState(savedSubdomain || projectId); + + // Update subdomain when savedSubdomain changes (e.g., when switching providers) + useEffect(() => { + setSubdomain(savedSubdomain || projectId); + }, [savedSubdomain, projectId]); // Validate subdomain: no periods allowed (only single-level subdomains) const hasPeriod = subdomain.includes('.');