Skip to content

Commit 7f2f853

Browse files
committed
Daily POTD check status issue fixed
1 parent d2e9cef commit 7f2f853

File tree

1 file changed

+7
-2
lines changed
  • client-test/src/components/Challenges

1 file changed

+7
-2
lines changed

client-test/src/components/Challenges/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,15 @@ const Challenges: React.FC = () => {
273273
setIsRefreshing(true);
274274
try {
275275
await fetchDailyChallenge();
276-
toast.success("Problem of the Day is Solved!");
276+
if (isSolved) {
277+
toast.success("Problem of the Day is Solved!");
278+
}
279+
else {
280+
toast.error("Haven't solved the Problem of the Day yet.");
281+
}
277282
} catch (error) {
278283
console.error("Error updating POTD status:", error);
279-
toast.error("Haven't solved the Problem of the Day yet.");
284+
toast.error("Error Checking for Status");
280285
} finally {
281286
setIsRefreshing(false);
282287
}

0 commit comments

Comments
 (0)