fix: this commit tries to fix issue of blank UI
This commit is contained in:
parent
7b40e8bafa
commit
e7e510a218
1 changed files with 37 additions and 32 deletions
|
|
@ -89,11 +89,13 @@ export function TabsProvider({ children }: { children: ReactNode }) {
|
|||
let cookie = window.localStorage.getItem("tabsData");
|
||||
if (cookie && Object.keys(templates).length > 0) {
|
||||
let cookieObject: LangFlowState = JSON.parse(cookie);
|
||||
try {
|
||||
cookieObject.flows.forEach((flow) => {
|
||||
flow.data.edges.forEach((edge) => {
|
||||
edge.className = "";
|
||||
edge.style = { stroke: "#555555" };
|
||||
});
|
||||
|
||||
flow.data.nodes.forEach((node) => {
|
||||
const template = templates[node.data.type];
|
||||
if (!template) {
|
||||
|
|
@ -122,6 +124,9 @@ export function TabsProvider({ children }: { children: ReactNode }) {
|
|||
setTabIndex(cookieObject.tabIndex);
|
||||
setFlows(cookieObject.flows);
|
||||
setId(cookieObject.id);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
}, [templates]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue