Skip to content

Commit d2dddc5

Browse files
committed
fix: quiz results being blank
1 parent ad53461 commit d2dddc5

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

client/src/components/QuizArea.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { motion, AnimatePresence } from "framer-motion";
1+
import { motion, AnimatePresence } from "motion/react";
22
import { type QuizAreaProps } from "@/types/quiz";
33
import { useIsMobile } from "@/hooks/useIsMobile";
44

client/src/routes/Quiz/QuizResults.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ export const QuizResults = () => {
3838
try {
3939
const response = await getQuizResults(quizId);
4040
if (response.success) {
41+
if (!response.data.found) {
42+
toast.error("Quiz results not found or have expired.");
43+
navigate("/");
44+
return;
45+
}
4146
const mappedData = {
4247
...response.data,
4348
id: response.data.id || response.data.quizId || quizId,

0 commit comments

Comments
 (0)