fix(onboarding): skip db-settings step if no database is found on the agent

This commit is contained in:
Théo LAGACHE
2026-06-19 14:44:32 +02:00
parent ec07424ddf
commit 50f7fb17e8
2 changed files with 15 additions and 5 deletions
+7 -3
View File
@@ -43,7 +43,7 @@ export const OnboardingShell = () => {
<OnboardingStepper />
<div className="flex-1">{renderStep()}</div>
<div className="flex justify-between">
{currentIndex > 0 ? (
{currentIndex > 0 && (
<Button
type="button"
variant="ghost"
@@ -59,6 +59,12 @@ export const OnboardingShell = () => {
if (notifiers.length === 0 && storages.length === 0) {
prevId = "storage";
}
} else if (currentStepId === "finish") {
const databases =
(state.context.flowData.databases as unknown[]) || [];
if (databases.length === 0) {
prevId = "project-create";
}
}
if (prevId) goToStep(prevId);
}}
@@ -66,8 +72,6 @@ export const OnboardingShell = () => {
>
Back
</Button>
) : (
<div />
)}
<div className="flex gap-2">
{state.isSkippable && (
+8 -2
View File
@@ -118,8 +118,14 @@ export const onboardingSteps: OnboardingStep[] = [
id: "project-create",
component: StepProjectCreate,
isSkippable: true,
skipToStep: "db-settings",
nextStep: "db-settings",
skipToStep: (ctx: any) => {
const databases = (ctx.flowData?.databases as unknown[]) || [];
return databases.length === 0 ? "finish" : "db-settings";
},
nextStep: (ctx: any) => {
const databases = (ctx.flowData?.databases as unknown[]) || [];
return databases.length === 0 ? "finish" : "db-settings";
},
},
{
id: "db-settings",