CoolFace
Apppublic

Leon4gr45/builder

sourceHugging Facemitupdated 2d agoView on Hugging Face
0likes
first-run.ts12 linesDownload Raw Back to lib
1// Decide whether a fresh visitor should be dropped into an auto-created first project.2// False when any URL param indicates an existing destination (a specific project, an OAuth3// return, a doc, or settings), or when the user already has projects.4export function shouldAutoCreateFirstProject(opts: { search: string; projectCount: number }): boolean {5  if (opts.projectCount > 0) return false;6  const params = new URLSearchParams(opts.search);7  for (const key of ['project', 'code', 'error', 'doc', 'settings']) {8    if (params.has(key)) return false;9  }10  return true;11}12