1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-31 04:59:50 +02:00

Fix personalization not working

This commit is contained in:
Kamran Ahmed
2025-07-29 19:02:56 +01:00
parent 7f1da76f38
commit 7e1c9b18e5

View File

@@ -153,16 +153,13 @@ export function PersonalizedRoadmap(props: PersonalizedRoadmapProps) {
}); });
} else if (userProgress?.personalized) { } else if (userProgress?.personalized) {
const { topicIds } = userProgress.personalized; const { topicIds } = userProgress.personalized;
const remainingTopicIds = allPendingNodeIds.filter( // user is asking for personalized roadmap, we need to
(nodeId) => !topicIds.includes(nodeId), // mark all the pending ids which are in the personalized roadmap
); // as skipped and mark the rest as pending
allPendingNodeIds.forEach((topicId) => {
remainingTopicIds.forEach((topicId) => { if (topicIds.includes(topicId)) {
renderTopicProgress(topicId, 'skipped'); renderTopicProgress(topicId, 'skipped');
}); } else {
topicIds.forEach((topicId) => {
if (!alreadyInProgressNodeIds.has(topicId)) {
renderTopicProgress(topicId, 'pending'); renderTopicProgress(topicId, 'pending');
} }
}); });