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
+6
View File
@@ -9267,15 +9267,21 @@ const AngularWorkflow = (defaultprops) => {
break
}
const execution = workflowExecutions[executionKey]
if (execution.execution_argument === undefined || execution.execution_argument === null || execution.execution_argument.length < 2) {
continue
}
if (execution.execution_argument.includes("too large ")) {
continue
}
if (availableArguments.includes(execution.execution_argument)) {
continue
}
availableArguments.push(execution.execution_argument)
}
}
-53
View File
@@ -290,59 +290,6 @@ const Settings = (props) => {
}
};
// const registerProviders = (userdata) => {
// // Register hooks here
// detectEthereumProvider().then((provider) => {
// if (provider) {
// if (!provider.isMetaMask) {
// toast("Only MetaMask is supported as of now.");
// return;
// }
// // Find the ethereum network
// // Get the users' account(s)
// //toast("Connecting to MetaMask")
// //console.log("Connected: ", provider.isConnected())
// if (!provider.isConnected()) {
// toast("Metamask is not connected.");
// return;
// }
// provider.on("message", (event) => {
// toast("Ethereum message: ", event);
// });
// provider.on("chainChanged", (chainId) => {
// console.log("Changed chain to: ", chainId);
// const method = "eth_getBalance";
// const params = [userdata.eth_info.account, "latest"];
// provider
// .request({
// method: method,
// params,
// })
// .then((result) => {
// console.log("Got result: ", result);
// if (result !== undefined && result !== null) {
// userdata.eth_info.balance = result;
// userdata.eth_info.parsed_balance = result / 1000000000000000000;
// console.log("INFO: ", userdata);
// setUserData(userdata);
// } else {
// toast("Couldn't find balance: ", result);
// }
// })
// .catch((error) => {
// // If the request fails, the Promise will reject with an error.
// toast("Failed getting info from ethereum API: " + error);
// });
// });
// }
// });
// };
// This should "always" have data
useEffect(() => {
if (firstrequest) {
+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) {