Skip to content

Commit

Permalink
refactor: handle null topology ids properly
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe authored and moshloop committed Jul 2, 2024
1 parent 45ed89e commit ed4939e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/Topology/TopologyBreadcrumbs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ function TopologyBreadcrumbItem({
}) {
const { data: component } = useComponentNameQuery(topologyId, {});

console.log(component);

if (!component) {
return null;
}
Expand Down Expand Up @@ -49,9 +51,9 @@ export function TopologyBreadcrumbs({

const ids = useMemo(() => {
const topologyIds = [
...(component?.path || "").split("."),
refererId,
topologyId
...(component?.path ? (component.path || "").split(".") : []),
...(refererId ? [refererId] : []),
...(topologyId ? [topologyId] : [])
].filter((v) => v?.trim());
return topologyIds as string[];
}, [component, topologyId, refererId]);
Expand Down

0 comments on commit ed4939e

Please sign in to comment.