mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
StepFinish was calling router.push() directly, bypassing the next() call that triggers onFlowComplete in OnboardingClient, preventing the onboarding-done cookie from being written and causing infinite redirect loops. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
1017 B
TypeScript
30 lines
1017 B
TypeScript
"use client";
|
|
|
|
import { useEffect, useRef } from "react";
|
|
import { useOnboarding } from "@onboardjs/react";
|
|
import confetti from "canvas-confetti";
|
|
import { CheckCircle2 } from "lucide-react";
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
export const StepFinish = () => {
|
|
const { next } = useOnboarding();
|
|
const fired = useRef(false);
|
|
|
|
useEffect(() => {
|
|
if (fired.current) return;
|
|
fired.current = true;
|
|
confetti({ particleCount: 150, spread: 80, origin: { y: 0.6 } });
|
|
}, []);
|
|
|
|
return (
|
|
<div className="flex flex-col items-center justify-center gap-4 h-full text-center">
|
|
<CheckCircle2 className="size-16 text-green-500" />
|
|
<h1 className="text-2xl font-semibold">You're all set!</h1>
|
|
<p className="text-sm text-muted-foreground">Your workspace is ready to use.</p>
|
|
<Button type="button" onClick={async () => { await next(); }}>
|
|
Go to dashboard
|
|
</Button>
|
|
</div>
|
|
);
|
|
};
|