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,19 +146,21 @@ 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;
|
||||||
}
|
}
|
||||||
setData((prev) => {
|
|
||||||
let newData = _.cloneDeep(prev);
|
|
||||||
Object.keys(storeComponents).forEach((key) => {
|
|
||||||
newData["custom_components"][key] = storeComponents[key];
|
|
||||||
});
|
|
||||||
return newData;
|
|
||||||
});
|
|
||||||
processDataFromFlow(flow, false);
|
processDataFromFlow(flow, false);
|
||||||
} catch (e) {}
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setData((prev) => {
|
||||||
|
let newData = _.cloneDeep(prev);
|
||||||
|
Object.keys(storeComponents).forEach((key) => {
|
||||||
|
newData["custom_components"][key] = storeComponents[key];
|
||||||
|
});
|
||||||
|
return newData;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -145,31 +145,33 @@ export default function HomePage(): JSX.Element {
|
||||||
<SkeletonCardComponent />
|
<SkeletonCardComponent />
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
flows.map((flow, idx) => (
|
flows
|
||||||
<CardComponent
|
.filter((flow) => !flow.is_component)
|
||||||
key={idx}
|
.map((flow, idx) => (
|
||||||
flow={flow}
|
<CardComponent
|
||||||
id={flow.id}
|
key={idx}
|
||||||
button={
|
flow={flow}
|
||||||
<Link to={"/flow/" + flow.id}>
|
id={flow.id}
|
||||||
<Button
|
button={
|
||||||
variant="outline"
|
<Link to={"/flow/" + flow.id}>
|
||||||
size="sm"
|
<Button
|
||||||
className="whitespace-nowrap "
|
variant="outline"
|
||||||
>
|
size="sm"
|
||||||
<IconComponent
|
className="whitespace-nowrap "
|
||||||
name="ExternalLink"
|
>
|
||||||
className="main-page-nav-button"
|
<IconComponent
|
||||||
/>
|
name="ExternalLink"
|
||||||
Edit Flow
|
className="main-page-nav-button"
|
||||||
</Button>
|
/>
|
||||||
</Link>
|
Edit Flow
|
||||||
}
|
</Button>
|
||||||
onDelete={() => {
|
</Link>
|
||||||
removeFlow(flow.id);
|
}
|
||||||
}}
|
onDelete={() => {
|
||||||
/>
|
removeFlow(flow.id);
|
||||||
))
|
}}
|
||||||
|
/>
|
||||||
|
))
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue