diff --git a/src/renderer/src/components/onboarding/stages/initial-space/create.tsx b/src/renderer/src/components/onboarding/stages/initial-space/create.tsx index ab44b031..3b68fefd 100644 --- a/src/renderer/src/components/onboarding/stages/initial-space/create.tsx +++ b/src/renderer/src/components/onboarding/stages/initial-space/create.tsx @@ -58,20 +58,23 @@ export function OnboardingCreateSpace({ }, []); // Create the space in the main profile - const createSpace = async () => { + const createSpace = async (name?: string) => { if (!mainProfile || isCreating || createSuccess) return; setIsCreating(true); setErrorMessage(null); try { + // Use the provided name or the current spaceName + const spaceToCreate = name || spaceName; + // Create the space with just the name - const created = await flow.spaces.createSpace(mainProfile.id, spaceName); + const created = await flow.spaces.createSpace(mainProfile.id, spaceToCreate); if (created) { // Get all spaces to find the one we just created const spaces = await flow.spaces.getSpacesFromProfile(mainProfile.id); - const newSpace = spaces.find((s) => s.name === spaceName); + const newSpace = spaces.find((s) => s.name === spaceToCreate); if (newSpace) { // Save the space ID for the next steps @@ -96,6 +99,17 @@ export function OnboardingCreateSpace({ } }; + // Handle skip action + const handleSkip = async () => { + if (mainProfile && !hasSpaces) { + // If we have a main profile but no spaces, create a default one + await createSpace(DEFAULT_SPACE_NAME); + } else { + // Otherwise just advance + advance(); + } + }; + return ( <> Something went wrong
{errorMessage}