Skip to content

Commit 9d826a6

Browse files
committed
fix:rm-cooldown-for-dsa-track
1 parent df87229 commit 9d826a6

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

src/routes/(app)/tracks/[trackName]/+page.svelte

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,14 @@
6565
expandedSections = expandedSections;
6666
}
6767
68-
// Update cooldown status
69-
updateCooldownStatus();
70-
cooldownInterval = setInterval(updateCooldownStatus, 1000);
68+
// Update cooldown status (disabled for dsa-bootcamp)
69+
if ($page.params.trackName !== 'dsa-bootcamp') {
70+
updateCooldownStatus();
71+
cooldownInterval = setInterval(updateCooldownStatus, 1000);
72+
} else {
73+
// For dsa-bootcamp, always allow completion
74+
canCompleteNow = true;
75+
}
7176
7277
return () => {
7378
if (cooldownInterval) clearInterval(cooldownInterval);
@@ -99,7 +104,8 @@
99104
return; // Prevent double submissions
100105
}
101106
102-
if (!canCompleteNow) {
107+
// Cooldown check (disabled for dsa-bootcamp)
108+
if ($page.params.trackName !== 'dsa-bootcamp' && !canCompleteNow) {
103109
toast.info(`⏱️ Take a quick break! You can submit again in ${cooldownTimeString}.\n\nCome back stronger! 💪`, 5000);
104110
return;
105111
}
@@ -127,7 +133,10 @@
127133
128134
// Update local state IMMEDIATELY for instant UI feedback
129135
lastCompletedAt = new Date().toISOString();
130-
updateCooldownStatus();
136+
// Update cooldown status (disabled for dsa-bootcamp)
137+
if ($page.params.trackName !== 'dsa-bootcamp') {
138+
updateCooldownStatus();
139+
}
131140
132141
// Track this problem as locally completed (for optimistic UI)
133142
locallyCompletedIds.add(problemId);
@@ -224,7 +233,10 @@
224233
totalBloksEarned = data.totalBloksEarned;
225234
lastCompletedAt = data.lastCompletedAt;
226235
user = data.user;
227-
updateCooldownStatus();
236+
// Update cooldown status (disabled for dsa-bootcamp)
237+
if ($page.params.trackName !== 'dsa-bootcamp') {
238+
updateCooldownStatus();
239+
}
228240
}
229241
</script>
230242

0 commit comments

Comments
 (0)