We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f8d537 commit a45e237Copy full SHA for a45e237
src/routes/projects/[projectId]/workflows/[workflowId]/+page.svelte
@@ -46,6 +46,18 @@
46
datasets = $page.data.datasets;
47
});
48
49
+ // Add an event listener for the 'beforeunload' event
50
+ window.addEventListener('beforeunload', function(e) {
51
+ if (argumentsWithUnsavedChanges === true) {
52
+ // Cancel the event
53
+ e.preventDefault();
54
+ // Toggle the modal
55
+ toggleUnsavedChangesModal();
56
+ // Chrome requires returnValue to be set
57
+ e.returnValue = '';
58
+ }
59
+ });
60
+
61
async function handleExportWorkflow() {
62
const response = await fetch(`/projects/${project.id}/workflows/${workflow.id}/export`, {
63
method: 'GET',
0 commit comments