Skip to main content

useWelcomeFlow

Controls first-run welcome vs main generator UI.

State​

  • showWelcome — default true unless URL has ?id= generation param
  • loadGenerationId — input for “open existing” flow

Actions​

HandlerEffect
handleLoadGenerationrouter.push('/card-generator?id=…')
handleNewGenerationhides welcome
returnToWelcomereset + router.replace('/card-generator')
clearWelcomeFlowreset state only

Uses useSearchParams + useRouter from next/navigation.


Sources: src/app/card-generator/hooks/useWelcomeFlow.ts