fix(tabsContext.tsx): fix issue with missing return statement causing incorrect data processing
fix(tabsContext.tsx): move setData function call outside of try-catch block to ensure it always executes fix(MainPage/index.tsx): filter out component flows from the list of flows to be rendered
This commit is contained in:
parent
315fe42e0b
commit
a41032def7
2 changed files with 40 additions and 36 deletions
|
|
@ -146,10 +146,15 @@ export function TabsProvider({ children }: { children: ReactNode }) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flow.data && flow.is_component) {
|
if (flow.data && flow.is_component) {
|
||||||
storeComponents[(flow.data.nodes[0].data as NodeDataType).type] = (
|
storeComponents[(flow.data.nodes[0].data as NodeDataType).type] =
|
||||||
flow.data.nodes[0].data as NodeDataType
|
_.cloneDeep((flow.data.nodes[0].data as NodeDataType).node!);
|
||||||
).node!;
|
return;
|
||||||
}
|
}
|
||||||
|
processDataFromFlow(flow, false);
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
setData((prev) => {
|
setData((prev) => {
|
||||||
let newData = _.cloneDeep(prev);
|
let newData = _.cloneDeep(prev);
|
||||||
Object.keys(storeComponents).forEach((key) => {
|
Object.keys(storeComponents).forEach((key) => {
|
||||||
|
|
@ -157,9 +162,6 @@ export function TabsProvider({ children }: { children: ReactNode }) {
|
||||||
});
|
});
|
||||||
return newData;
|
return newData;
|
||||||
});
|
});
|
||||||
processDataFromFlow(flow, false);
|
|
||||||
} catch (e) {}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function processFlowEdges(flow: FlowType) {
|
function processFlowEdges(flow: FlowType) {
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,9 @@ export default function HomePage(): JSX.Element {
|
||||||
<SkeletonCardComponent />
|
<SkeletonCardComponent />
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
flows.map((flow, idx) => (
|
flows
|
||||||
|
.filter((flow) => !flow.is_component)
|
||||||
|
.map((flow, idx) => (
|
||||||
<CardComponent
|
<CardComponent
|
||||||
key={idx}
|
key={idx}
|
||||||
flow={flow}
|
flow={flow}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue