diff --git a/src/frontend/src/components/inputListComponent/index.tsx b/src/frontend/src/components/inputListComponent/index.tsx index d81da6183..5c9c0e78b 100644 --- a/src/frontend/src/components/inputListComponent/index.tsx +++ b/src/frontend/src/components/inputListComponent/index.tsx @@ -23,7 +23,7 @@ export default function InputListComponent({
{inputList.map((i, idx) => ( diff --git a/src/frontend/src/contexts/tabsContext.tsx b/src/frontend/src/contexts/tabsContext.tsx index cf4303a4d..75d4dd73b 100644 --- a/src/frontend/src/contexts/tabsContext.tsx +++ b/src/frontend/src/contexts/tabsContext.tsx @@ -268,7 +268,7 @@ export function TabsProvider({ children }: { children: ReactNode }) { /** * Downloads the current flow as a JSON file */ - function downloadFlow(flow: FlowType) { + function downloadFlow(flow: FlowType, fileName?: string) { // create a data URI with the current flow data const jsonString = `data:text/json;chatset=utf-8,${encodeURIComponent( JSON.stringify(flow) @@ -277,7 +277,7 @@ export function TabsProvider({ children }: { children: ReactNode }) { // create a link element and set its properties const link = document.createElement("a"); link.href = jsonString; - link.download = `${flows.find((f) => f.id === tabId).name}.json`; + link.download = `${fileName && fileName != "" ? fileName : flows.find((f) => f.id === tabId).name}.json`; // simulate a click on the link element to trigger the download link.click(); diff --git a/src/frontend/src/modals/exportModal/index.tsx b/src/frontend/src/modals/exportModal/index.tsx index 236c27366..3febacf9f 100644 --- a/src/frontend/src/modals/exportModal/index.tsx +++ b/src/frontend/src/modals/exportModal/index.tsx @@ -80,9 +80,9 @@ export default function ExportModal() {