feat(error): add error handling on test screen

This commit is contained in:
shafin-r
2026-02-07 20:21:47 +06:00
parent c9db96f97f
commit 8cfcb11f0a
4 changed files with 52 additions and 48 deletions

View File

@ -5,6 +5,7 @@ import type { StartExamPayload, ExamMode } from "../types/test";
interface ExamConfigState {
payload: StartExamPayload | null;
userXp: number;
setSheetId: (id: string) => void;
storeTopics: (ids: string[]) => void;
@ -14,6 +15,7 @@ interface ExamConfigState {
storeDuration: (minutes: number) => void;
setMode: (mode: ExamMode) => void;
setSection: (section: string) => void;
setUserXp: (section: number) => void;
clearPayload: () => void;
}
@ -22,6 +24,7 @@ export const useExamConfigStore = create<ExamConfigState>()(
persist(
(set, get) => ({
payload: null,
userXp: 0,
setSheetId: (sheet_id) =>
set({
@ -45,6 +48,13 @@ export const useExamConfigStore = create<ExamConfigState>()(
section,
} as StartExamPayload,
}),
setUserXp: (userXp) =>
set({
payload: {
...(get().payload ?? {}),
userXp,
} as StartExamPayload,
}),
setDifficulty: (difficulty) =>
set({