diff --git a/src/components/Componentes/test-questions-flow.tsx b/src/components/Componentes/test-questions-flow.tsx index 38329d3..34fba72 100644 --- a/src/components/Componentes/test-questions-flow.tsx +++ b/src/components/Componentes/test-questions-flow.tsx @@ -12,7 +12,6 @@ import NavigationButton from "./navigation-button"; import { PageBackground } from "./page-background"; import StickyHeader from "./sticky-header"; import TestExitSheet from "./test-exit-sheet"; -import TestLoadingScreen from "./test-loading-screen"; export type QuestionOption = { id: string; @@ -225,15 +224,6 @@ export default function TestQuestionsFlow({ } }; - if (isSubmitting) { - return ( - - ); - } - if (!currentQuestion) { return null; } @@ -426,6 +416,7 @@ export default function TestQuestionsFlow({ !areAllQuestionsAnswered || isSubmitting } + isLoading={isSubmitting} onClick={handleFinishSubmit} > {finishLabel} diff --git a/src/hooks/marriage/use-cattell.ts b/src/hooks/marriage/use-cattell.ts index 413d6cd..9c13234 100644 --- a/src/hooks/marriage/use-cattell.ts +++ b/src/hooks/marriage/use-cattell.ts @@ -86,9 +86,12 @@ export function useSubmitCattellAssessmentMutation( queryKey: marriageQueryKeys.cattellResult(), }); queryClient.setQueriesData( - { queryKey: ["marriage", "form-schema", "profile"] }, + { queryKey: [...marriageQueryKeys.all, "form-overview"] }, (schema) => markAssessmentCompleted(schema, "personality_test"), ); + await queryClient.invalidateQueries({ + queryKey: [...marriageQueryKeys.all, "form-overview"], + }); await options?.onSuccess?.(data, variables, onMutateResult, context); }, }); diff --git a/src/hooks/marriage/use-glasser.ts b/src/hooks/marriage/use-glasser.ts index d4685a9..005d2b5 100644 --- a/src/hooks/marriage/use-glasser.ts +++ b/src/hooks/marriage/use-glasser.ts @@ -61,7 +61,7 @@ export function useSubmitGlasserAssessmentMutation( queryKey: marriageQueryKeys.glasserResult(), }); queryClient.setQueriesData( - { queryKey: ["marriage", "form-schema", "profile"] }, + { queryKey: [...marriageQueryKeys.all, "form-overview"] }, (schema) => { if (!schema) return schema; const slug = "glasser_5_needs_test"; @@ -84,11 +84,19 @@ export function useSubmitGlasserAssessmentMutation( total_steps: 1, completion_percent: 100, }, + glasser: { + current_step: 1, + total_steps: 1, + completion_percent: 100, + }, }, }, }; }, ); + await queryClient.invalidateQueries({ + queryKey: [...marriageQueryKeys.all, "form-overview"], + }); await options?.onSuccess?.(data, variables, onMutateResult, context); }, });