From 6e3cbdc228f8f2b788aabc059480d2ef962573fd Mon Sep 17 00:00:00 2001 From: vickytechkey Date: Sun, 23 Aug 2026 18:38:18 +0530 Subject: [PATCH] applying the fix --- src/components/pages/OnboardingWizard.tsx | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/components/pages/OnboardingWizard.tsx b/src/components/pages/OnboardingWizard.tsx index ddd49c6..f1d198e 100644 --- a/src/components/pages/OnboardingWizard.tsx +++ b/src/components/pages/OnboardingWizard.tsx @@ -10,16 +10,24 @@ export default function OnboardingWizard() { storeSlug, setStoreSlug, supportEmail, setSupportEmail, supportPhone, setSupportPhone, - selectedCategories, setSelectedCategories + selectedCategories, setSelectedCategories, + saveProfileBackend } = useSeller(); const handleNext = () => { - if (profileStep < 3) { - setProfileStep(profileStep + 1); - } else { - setIsProfileComplete(true); - setCurrentPage('dashboard'); - } + const isLastStep = profileStep === 3; + saveProfileBackend(isLastStep) + .then(() => { + if (!isLastStep) { + setProfileStep(profileStep + 1); + } else { + setIsProfileComplete(true); + setCurrentPage('dashboard'); + } + }) + .catch((err: Error) => { + alert("Failed to save progress: " + err.message); + }); }; const handleBack = () => {