diff --git a/opensaas-sh/app_diff/src/admin/dashboards/analytics/AnalyticsDashboardPage.tsx.diff b/opensaas-sh/app_diff/src/admin/dashboards/analytics/AnalyticsDashboardPage.tsx.diff index 8d78b92f..29cfcaa4 100644 --- a/opensaas-sh/app_diff/src/admin/dashboards/analytics/AnalyticsDashboardPage.tsx.diff +++ b/opensaas-sh/app_diff/src/admin/dashboards/analytics/AnalyticsDashboardPage.tsx.diff @@ -7,8 +7,8 @@ import { useQuery, getDailyStats } from 'wasp/client/operations'; import TotalSignupsCard from './TotalSignupsCard'; import TotalPageViewsCard from './TotalPageViewsCard'; -@@ -10,12 +12,54 @@ - import { useRedirectHomeUnlessUserIsAdmin } from '../../useRedirectHomeUnlessUserIsAdmin'; +@@ -11,16 +13,58 @@ + import { cn } from '../../../client/cn'; const Dashboard = ({ user }: { user: AuthUser }) => { + const [isDemoInfoVisible, setIsDemoInfoVisible] = useState(false); @@ -16,21 +16,19 @@ const { data: stats, isLoading, error } = useQuery(getDailyStats); ++ const didUserCloseDemoInfo = localStorage.getItem('didUserCloseDemoInfo') === 'true'; ++ + useEffect(() => { -+ try { -+ if (localStorage.getItem('isStripeDemoInfoVisible') === 'false') { -+ // do nothing -+ } else { -+ setIsDemoInfoVisible(true); -+ } -+ } catch (error) { -+ console.error(error); ++ if (didUserCloseDemoInfo || !stats) { ++ setIsDemoInfoVisible(false); ++ } else if (!didUserCloseDemoInfo && stats) { ++ setIsDemoInfoVisible(true); + } -+ }, []); ++ }, [stats]); + + const handleDemoInfoClose = () => { + try { -+ localStorage.setItem('isStripeDemoInfoVisible', 'false'); ++ localStorage.setItem('didUserCloseDemoInfo', 'true'); + setIsDemoInfoVisible(false); + } catch (error) { + console.error(error); @@ -60,9 +58,18 @@ + + )}
-
+-
++
-@@ -36,7 +80,7 @@ +
@@ -71,3 +78,14 @@
+@@ -47,9 +91,7 @@ + {!stats && ( +
+
+-

+- No daily stats generated yet +-

++

No daily stats generated yet

+

+ Stats will appear here once the daily stats job has run +