diff --git a/app/sites/[id]/page.tsx b/app/sites/[id]/page.tsx index 7c4acac..e6bed47 100644 --- a/app/sites/[id]/page.tsx +++ b/app/sites/[id]/page.tsx @@ -416,7 +416,9 @@ export default function SiteDashboardPage() { if (site?.domain) document.title = `${site.domain} | Pulse` }, [site?.domain]) - const showSkeleton = useMinimumLoading(overviewLoading) + // Skip the minimum-loading skeleton when SWR already has cached data + // (prevents the 300ms flash when navigating back to the dashboard) + const showSkeleton = useMinimumLoading(overviewLoading && !overview) if (showSkeleton) { return diff --git a/components/dashboard/Locations.tsx b/components/dashboard/Locations.tsx index 1f4b7e6..5c89e00 100644 --- a/components/dashboard/Locations.tsx +++ b/components/dashboard/Locations.tsx @@ -1,14 +1,16 @@ 'use client' import { useState, useEffect } from 'react' +import dynamic from 'next/dynamic' import { motion } from 'framer-motion' import { logger } from '@/lib/utils/logger' import { formatNumber } from '@ciphera-net/ui' import { useTabListKeyboard } from '@/lib/hooks/useTabListKeyboard' import * as Flags from 'country-flag-icons/react/3x2' import iso3166 from 'iso-3166-2' -import DottedMap from './DottedMap' -import Globe from './Globe' + +const DottedMap = dynamic(() => import('./DottedMap'), { ssr: false }) +const Globe = dynamic(() => import('./Globe'), { ssr: false }) import { Modal, GlobeIcon } from '@ciphera-net/ui' import { ListSkeleton } from '@/components/skeletons' import { ShieldCheck, Detective, Broadcast } from '@phosphor-icons/react'