diff --git a/src/app/questions-list/questions-list-client.tsx b/src/app/questions-list/questions-list-client.tsx index 7365757..6d064e5 100644 --- a/src/app/questions-list/questions-list-client.tsx +++ b/src/app/questions-list/questions-list-client.tsx @@ -164,7 +164,11 @@ export default function QuestionsListClient({ const startMatchMutation = useStartMarriageMatchMutation({ onSuccess: () => { markMatchStarted(); - router.replace(localizePath("/finding-match", locale)); + if (onClose) { + onClose(); + } else { + router.replace(localizePath("/finding-match", locale)); + } }, onError: () => { // Never pretend the request went through – the user stays here and can @@ -674,6 +678,10 @@ export default function QuestionsListClient({ try { await syncPendingAnswers(); + if (onClose) { + onClose(); + return; + } startMatchMutation.mutate(); } catch (err) { console.error("Failed to sync pending sections:", err);