This commit is contained in:
Charlie Kolb 2025-03-04 15:54:08 +01:00
parent 7695162ffa
commit 2789d3d127
No known key found for this signature in database

View file

@ -1141,19 +1141,20 @@ export function useWorkflowHelpers(options: { router: ReturnType<typeof useRoute
showClose: true, showClose: true,
}, },
); );
if (confirmModal === MODAL_CONFIRM) { if (confirmModal === MODAL_CONFIRM) {
const saved = await saveCurrentWorkflow({}, false); const saved = await saveCurrentWorkflow({}, false);
if (saved) { if (saved) {
await npsSurveyStore.fetchPromptsData(); await npsSurveyStore.fetchPromptsData();
uiStore.stateIsDirty = false; uiStore.stateIsDirty = false;
const goToNext = await confirm(); const goToNext = await confirm();
if (goToNext) { next(goToNext);
next();
}
} else { } else {
router.resolve({ name: VIEWS.WORKFLOW, params: { name: workflowsStore.workflow.id } }); next(
next(false); router.resolve({
name: VIEWS.WORKFLOW,
params: { name: workflowsStore.workflow.id },
}),
);
} }
} else if (confirmModal === MODAL_CANCEL) { } else if (confirmModal === MODAL_CANCEL) {
await cancel(); await cancel();
@ -1162,8 +1163,12 @@ export function useWorkflowHelpers(options: { router: ReturnType<typeof useRoute
next(); next();
} else if (confirmModal === MODAL_CLOSE) { } else if (confirmModal === MODAL_CLOSE) {
// The route may have already changed due to the browser back button, so let's restore it // The route may have already changed due to the browser back button, so let's restore it
router.resolve({ name: VIEWS.WORKFLOW, params: { name: workflowsStore.workflow.id } }); next(
next(false); router.resolve({
name: VIEWS.WORKFLOW,
params: { name: workflowsStore.workflow.id },
}),
);
} }
} else { } else {
next(); next();