Preserve subdomain in Shakespeare Deploy

This commit is contained in:
Alex Gleason committed 2025-12-09 19:58:18 -06:00
1 parent 83b20c88f0
commit dd0f105c87
2 files changed
+11 -1

No files matched your search

+3
View File
@@ -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 (
<ShakespeareDeployForm
host={shakespeareProvider.host}
projectId={projectId}
savedSubdomain={savedSubdomain}
onSubdomainChange={handleShakespeareSubdomainChange}
onValidationChange={handleShakespeareValidationChange}
/>
@@ -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('.');