fix crash when upload large file, not saving files on browser storage (#362)
This commit is contained in:
commit
ee041f4d91
1 changed files with 15 additions and 2 deletions
|
|
@ -50,10 +50,23 @@ export function TabsProvider({ children }: { children: ReactNode }) {
|
||||||
return newNodeId.current;
|
return newNodeId.current;
|
||||||
}
|
}
|
||||||
function save() {
|
function save() {
|
||||||
if (flows.length !== 0)
|
let Saveflows = [...flows];
|
||||||
|
if (Saveflows.length !== 0)
|
||||||
|
Saveflows.forEach((flow) => {
|
||||||
|
if(flow.data && flow.data?.nodes) flow.data?.nodes.forEach((node) => {
|
||||||
|
console.log(node.data.type)
|
||||||
|
Object.keys(node.data.node.template).forEach((key) => {
|
||||||
|
console.log(node.data.node.template[key].type)
|
||||||
|
if(node.data.node.template[key].type==="file"){
|
||||||
|
console.log(node.data.node.template[key])
|
||||||
|
node.data.node.template[key].content = "";
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
window.localStorage.setItem(
|
window.localStorage.setItem(
|
||||||
"tabsData",
|
"tabsData",
|
||||||
JSON.stringify({ tabIndex, flows, id})
|
JSON.stringify({ tabIndex, flows:Saveflows, id})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue