diff --git a/ui/Puzzle.tsx b/ui/Puzzle.tsx index 777a012..c7e97e0 100644 --- a/ui/Puzzle.tsx +++ b/ui/Puzzle.tsx @@ -62,8 +62,10 @@ export default function Puzzle({ token, id }: { token: string; id: number }) { if (res.ok || res.status === 406 || res.status === 423) { const data = res.ok || res.status === 406 ? ((await res.json()) as Granted) : null; - if (data && data.score) mutate(`puzzles/${puzzle?.id}`); - else if (data && data.tries) setGranted(data); + if (data && data.score) { + mutate(`puzzles/${puzzle?.id}`); + mutate('puzzles'); + } else if (data && data.tries) setGranted(data); else if (res.ok && data?.success) setGranted({ tries: null, score: null, message: 'Réponse correcte' }); else if (res.status === 423)