diff --git a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/DownloadFile.svelte b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/DownloadFile.svelte index 6a9cc7b02c..674b766de6 100644 --- a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/DownloadFile.svelte +++ b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/DownloadFile.svelte @@ -57,8 +57,8 @@ (parameters.file_name = value.detail)} + value={parameters.fileName} + on:change={value => (parameters.fileName = value.detail)} /> {/if} diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index 612465323b..7564f3f36d 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -402,11 +402,11 @@ const closeSidePanelHandler = () => { const downloadFileHandler = async (action, _context) => { try { - let { url, file_name, type, attachment } = action.parameters + let { url, fileName, type, attachment } = action.parameters if (type === "attachment") { const attachmentObject = JSON.parse(attachment) url = attachmentObject.url - file_name = attachmentObject.name + fileName = attachmentObject.name } const response = await fetch(url) @@ -419,7 +419,7 @@ const downloadFileHandler = async (action, _context) => { const link = document.createElement("a") link.href = objectUrl - link.download = file_name + link.download = fileName link.click() URL.revokeObjectURL(objectUrl)