Add hasRealmChanges memo

cgen-bd2eede686b144c2a2bf3a78af7945a5
This commit is contained in:
Builder.io 2025-09-30 21:27:42 +00:00
parent e27f91ee13
commit 98e3f72215

View file

@ -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);