fix(editor): Close saving modal when workflow is new (#14836)

This commit is contained in:
Mutasem Aldmour
2025-04-29 15:48:25 +02:00
committed by GitHub
parent a33e3a807a
commit 48f0c91a47
5 changed files with 312 additions and 67 deletions

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import WorkflowExecutionsSidebar from '@/components/executions/workflow/WorkflowExecutionsSidebar.vue';
import { useWorkflowHelpers } from '@/composables/useWorkflowHelpers';
import { useWorkflowSaving } from '@/composables/useWorkflowSaving';
import { MAIN_HEADER_TABS } from '@/constants';
import type { ExecutionFilterType, IWorkflowDb } from '@/Interface';
import { getNodeViewTab } from '@/utils/nodeViewUtils';
@@ -33,7 +33,8 @@ const emit = defineEmits<{
reload: [];
}>();
const workflowHelpers = useWorkflowHelpers({ router: useRouter() });
const router = useRouter();
const { promptSaveUnsavedWorkflowChanges } = useWorkflowSaving({ router });
const temporaryExecution = computed<ExecutionSummary | undefined>(() =>
props.executions.find((execution) => execution.id === props.execution?.id)
@@ -72,7 +73,7 @@ onBeforeRouteLeave(async (to, _, next) => {
return;
}
await workflowHelpers.promptSaveUnsavedWorkflowChanges(next);
await promptSaveUnsavedWorkflowChanges(next);
});
</script>