builder / lib /first-run.ts
Leon4gr45's picture
Upload folder using huggingface_hub (part 2)
391c43e verified
Raw
History Blame Contribute Delete
580 Bytes
// Decide whether a fresh visitor should be dropped into an auto-created first project.
// False when any URL param indicates an existing destination (a specific project, an OAuth
// return, a doc, or settings), or when the user already has projects.
export function shouldAutoCreateFirstProject(opts: { search: string; projectCount: number }): boolean {
if (opts.projectCount > 0) return false;
const params = new URLSearchParams(opts.search);
for (const key of ['project', 'code', 'error', 'doc', 'settings']) {
if (params.has(key)) return false;
}
return true;
}