From 98e3f72215b9482f3b61dc1e03ec51701283c377 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 30 Sep 2025 21:27:42 +0000 Subject: [PATCH] Add hasRealmChanges memo cgen-bd2eede686b144c2a2bf3a78af7945a5 --- client/pages/Dashboard.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/client/pages/Dashboard.tsx b/client/pages/Dashboard.tsx index 7a082142..f6a3434c 100644 --- a/client/pages/Dashboard.tsx +++ b/client/pages/Dashboard.tsx @@ -256,6 +256,18 @@ export default function Dashboard() { setProfileCompletion(pct); }; + const hasRealmChanges = useMemo(() => { + const currentRealm = ((profile as any)?.user_type as RealmKey) ?? null; + const currentExperience = + ((profile as any)?.experience_level as string) || "beginner"; + const selectedRealmValue = userRealm ?? null; + const selectedExperienceValue = experienceLevel || "beginner"; + return ( + selectedRealmValue !== currentRealm || + selectedExperienceValue !== currentExperience + ); + }, [profile, userRealm, experienceLevel]); + const loadDashboardData = async () => { try { setIsLoading(true);