1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-09-01 05:21:43 +02:00

Update progress

This commit is contained in:
Kamran Ahmed
2024-06-23 15:22:15 +01:00
parent f5fc71aadb
commit 894b66f026

View File

@@ -98,12 +98,14 @@ export function clearMigratedRoadmapProgress(
const roadmapKey = `${resourceType}-${resourceId}-${userId}-progress`;
const clearedKey = `${resourceType}-${resourceId}-${userId}-cleared`;
if (localStorage.getItem(clearedKey)) {
const clearedCount = parseInt(localStorage.getItem(clearedKey) || '0', 10);
if (!clearedCount || clearedCount >= 10) {
return;
}
localStorage.removeItem(roadmapKey);
localStorage.setItem(clearedKey, '1');
localStorage.setItem(clearedKey, `${clearedCount + 1}`);
}
export async function getResourceProgress(