Skip to content

Commit d2fc2a6

Browse files
committed
fix(ui): redirect to onboarding when inventory ID is missing on import page
1 parent 2bf9e9b commit d2fc2a6

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • app/src/app/[lng]/cities/[cityId]/GHGI/onboarding/import

app/src/app/[lng]/cities/[cityId]/GHGI/onboarding/import/page.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,16 @@ export default function ImportPage(props: {
590590
setPendingNavigation(null);
591591
};
592592

593+
useEffect(() => {
594+
if (!inventoryId) {
595+
router.replace(`/${lng}/cities/${cityId}/GHGI/onboarding`);
596+
}
597+
}, [inventoryId, router, lng, cityId]);
598+
599+
if (!inventoryId) {
600+
return null;
601+
}
602+
593603
return (
594604
<>
595605
<Box pt={16} pb={16} maxW="full" mx="auto" w="1090px">

0 commit comments

Comments
 (0)