From a36f0f6b755e7ee3ea89947bc36d33d3dac06507 Mon Sep 17 00:00:00 2001 From: mortezaei Date: Fri, 15 May 2026 20:48:39 +0330 Subject: [PATCH] feat: add profile-based redirection in Intro component --- src/app/intro/page.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/intro/page.tsx b/src/app/intro/page.tsx index 2ebc320..d6af97e 100644 --- a/src/app/intro/page.tsx +++ b/src/app/intro/page.tsx @@ -1,7 +1,7 @@ "use client"; import Image from "next/image"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import { useRouter } from "next/navigation"; import Button from "@/components/ui/button"; import NavigationButton from "@/components/ui/navigation-button"; @@ -39,11 +39,19 @@ export default function Intro() { const router = useRouter(); const { dictionary: t, locale } = useI18n(); const { data: profile, refetch } = useMarriageProfileQuery({ - enabled: authBridge.isAuthenticated(), + retry: false, }); const [isReportSheetOpen, setIsReportSheetOpen] = useState(false); const [isSubmitting, setIsSubmitting] = useState(false); + useEffect(() => { + if (!profile) { + return; + } + + router.replace(localizePath(getSubmitPath(profile), locale)); + }, [locale, profile, router]); + const handleSubmit = async () => { if (isSubmitting) { return;