diff --git a/src/renderer/src/components/onboarding/OnboardingFlow.tsx b/src/renderer/src/components/onboarding/OnboardingFlow.tsx index b7f9484fe..0dc7738fb 100644 --- a/src/renderer/src/components/onboarding/OnboardingFlow.tsx +++ b/src/renderer/src/components/onboarding/OnboardingFlow.tsx @@ -84,7 +84,12 @@ export default function OnboardingFlow({ const shouldShowSkipToProjectSetup = currentStep.id !== 'repo' && currentStep.id !== 'tour' const shouldShowStepHeading = !isTourStep const footerPrimaryLabel = isTourStep ? 'Skip the tour' : primaryActionLabel - const { next: flowNext, openFolder: flowOpenFolder, skipTourToRepo: flowSkipTourToRepo } = flow + const { + next: flowNext, + openFolder: flowOpenFolder, + continueWithExistingProject: flowContinueWithExistingProject, + skipTourToRepo: flowSkipTourToRepo + } = flow // Why: depend on stable callbacks + step id only so the listener doesn't // re-bind on every render of the parent (flow object identity changes). useEffect(() => { @@ -110,14 +115,26 @@ export default function OnboardingFlow({ return } if (currentStep.id === 'repo') { - void flowOpenFolder() + if (flow.hasExistingProject) { + void flowContinueWithExistingProject('keyboard') + } else { + void flowOpenFolder() + } } else { void flowNext('keyboard') } } window.addEventListener('keydown', onKeyDown, { capture: true }) return () => window.removeEventListener('keydown', onKeyDown, { capture: true }) - }, [currentStep.id, flowNext, flowOpenFolder, flowSkipTourToRepo, tourStarted]) + }, [ + currentStep.id, + flow.hasExistingProject, + flowContinueWithExistingProject, + flowNext, + flowOpenFolder, + flowSkipTourToRepo, + tourStarted + ]) return (
)} - {currentStep.id !== 'repo' && ( + {(currentStep.id !== 'repo' || flow.hasExistingProject) && (