Fixed cache frontend issues related to editing/viewing

This commit is contained in:
Frikky
2024-01-30 01:37:46 +01:00
parent 5421a35c57
commit 42e5c7822a
7 changed files with 133 additions and 258 deletions
+20 -10
View File
@@ -1336,16 +1336,21 @@ const Workflows = (props) => {
};
const exportAllWorkflows = (allWorkflows) => {
for (var i = 0; i < allWorkflows.length; i++) {
console.log(allWorkflows[i])
setTimeout(() => {
console.log(allWorkflows[i])
exportWorkflow(allWorkflows[i], false)
}, i * 200);
}
for (var i = 0; i < allWorkflows.length; i++) {
const wf = allWorkflows[i]
toast(`Exporting and keeping original for all ${allWorkflows.length} workflows`);
};
if (wf === undefined || wf.id === undefined) {
continue
}
console.log("Exporting workflow: ", wf)
setTimeout(() => {
exportWorkflow(JSON.parse(JSON.stringify(wf)), false)
}, i * 100);
}
toast(`Exporting and keeping original for all ${allWorkflows.length} workflows`);
}
const deduplicateIds = (data, skip_sanitize) => {
if (data.triggers !== null && data.triggers !== undefined) {
@@ -1498,7 +1503,12 @@ const Workflows = (props) => {
};
const exportWorkflow = (data, sanitize) => {
data = JSON.parse(JSON.stringify(data));
try {
data = JSON.parse(JSON.stringify(data));
} catch (e) {
console.log("Failed to parse JSON: ", e);
}
let exportFileDefaultName = data.name + ".json";
if (sanitize === true) {