fix: reset store on getting started (#25607)
* reset store * Update apps/web/modules/onboarding/getting-started/onboarding-view.tsx Co-authored-by: Eunjae Lee <[email protected]> --------- Co-authored-by: Eunjae Lee <[email protected]>
This commit is contained in:
1 parent
dbb33b9632
commit
c91da96956
2 files changed
+12
-1
No files matched your search
@@ -25,10 +25,15 @@ type OnboardingViewProps = {
|
||||
export const OnboardingView = ({ userEmail }: OnboardingViewProps) => {
|
||||
const router = useRouter();
|
||||
const { t } = useLocale();
|
||||
const { selectedPlan, setSelectedPlan } = useOnboardingStore();
|
||||
const { selectedPlan, setSelectedPlan, resetOnboardingPreservingPlan } = useOnboardingStore();
|
||||
const previousPlanRef = useRef<PlanType | null>(null);
|
||||
const [isPending, startTransition] = useTransition();
|
||||
|
||||
// Reset onboarding data when visiting this page, but preserve the selected plan
|
||||
useEffect(() => {
|
||||
resetOnboardingPreservingPlan();
|
||||
}, []);
|
||||
|
||||
// Plan order mapping for determining direction
|
||||
const planOrder: Record<PlanType, number> = {
|
||||
personal: 0,
|
||||
|
||||
Reference in new issue
Block a user