|
3 | 3 | import { useCallback, useState, useEffect } from "react"; |
4 | 4 | import { useRouter } from "next/navigation"; |
5 | 5 | import { AlertTriangle } from "lucide-react"; |
6 | | -import { MerchantSidebar } from "@/components/layout"; |
| 6 | +import { MerchantSidebar, MobileNavDrawer, Topbar, Footer, MobileBottomNav } from "@/components/layout"; |
7 | 7 | import { merchantNavItems } from "@/lib/navigation/merchantNav"; |
8 | 8 | import { PageTransition, ErrorBoundary } from "@/components/shared"; |
9 | | -import { MobileNavDrawer } from "@/components/layout"; |
10 | | -import { Topbar } from "@/components/layout"; |
11 | | -import Footer from "@/components/layout"; |
12 | | -import { MobileBottomNav } from "@/components/layout"; |
13 | 9 | import { OnboardingWizard } from "@/components/onboarding/OnboardingWizard"; |
14 | 10 | import { useWalletStore } from "@/lib/store/walletStore"; |
15 | 11 | import { useAuthStore } from "@/lib/store/authStore"; |
@@ -55,9 +51,13 @@ export default function MerchantLayout({ |
55 | 51 | }, [logout, router, dismissWarning]); |
56 | 52 |
|
57 | 53 | useEffect(() => { |
58 | | - router.prefetch("/transactions"); |
59 | | - router.prefetch("/payments"); |
60 | | - }, [router]); |
| 54 | + try { |
| 55 | + router.prefetch("/transactions"); |
| 56 | + router.prefetch("/payments"); |
| 57 | + } catch { |
| 58 | + // Prefetch may throw during SSR or in edge environments |
| 59 | + } |
| 60 | + }, []); |
61 | 61 |
|
62 | 62 | return ( |
63 | 63 | <div className="flex h-screen overflow-hidden bg-background"> |
|
0 commit comments