akhaliq HF Staff commited on
Commit
b82cbe5
·
1 Parent(s): e2918f7
frontend/src/components/LandingPage.tsx CHANGED
@@ -356,11 +356,11 @@ Please redesign this with:
356
  ${createPR ? '\n\nNote: After generating the redesign, I will create a Pull Request on the original space.' : '\n\nNote: After generating the redesign, I can deploy to a new space or duplicate the original space.'}`;
357
 
358
  if (onStart) {
359
- // Extract repo ID from URL to pass directly (avoids state timing issues)
360
- const spaceMatch = redesignUrl.match(/huggingface\.co\/spaces\/([^\/\s\)]+\/[^\/\s\)]+)/);
361
- const extractedRepoId = spaceMatch ? spaceMatch[1] : undefined;
362
- console.log('[Redesign] Passing repoId to onStart:', extractedRepoId);
363
- onStart(redesignPrompt, result.language || 'html', selectedModel, extractedRepoId);
364
  }
365
 
366
  if (createPR) {
 
356
  ${createPR ? '\n\nNote: After generating the redesign, I will create a Pull Request on the original space.' : '\n\nNote: After generating the redesign, I can deploy to a new space or duplicate the original space.'}`;
357
 
358
  if (onStart) {
359
+ // For redesign WITHOUT PR: Don't pass repo ID (will create new space)
360
+ // For redesign WITH PR: We'll handle PR creation separately
361
+ console.log('[Redesign] createPR:', createPR);
362
+ console.log('[Redesign] Will pass repoId: undefined (let auto-deploy create new space)');
363
+ onStart(redesignPrompt, result.language || 'html', selectedModel, undefined);
364
  }
365
 
366
  if (createPR) {