Browse Source

fix(questions-list): close overlay and return to waiting screen when clicking submit in edit profile mode

master
mortezaei 2 weeks ago
parent
commit
b0ee500664
  1. 10
      src/app/questions-list/questions-list-client.tsx

10
src/app/questions-list/questions-list-client.tsx

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

Loading…
Cancel
Save