Skip to content

Commit

Permalink
fix(editor): fix can't construct multiple edges to multiple component…
Browse files Browse the repository at this point in the history
…s from single component (#1547)

Because

- For example, if I want to connect a to b,c,d. The factory we have
right now only form the first edge

This commit

- fix can't construct multiple edges to multiple components from single
component
  • Loading branch information
EiffelFly authored Oct 21, 2024
1 parent 0a4da01 commit 7ef2795
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/console/src/app/(providers)/root-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const RootProvider = ({
closeModal();
dismissToast();
setPreviousPathname(pathname);
}, [pathname, previousPathname]);
}, [pathname]);

return (
<ReactQueryProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ export function getReferencesFromAny(value: any) {
references: InstillReference[] = [],
): InstillReference[] {
if (Array.isArray(value)) {
const refs = [...references];
for (const item of value) {
const refs = getReferences(item, references);
return [...references, ...refs];
const itemRefs = getReferences(item, references);
refs.push(...itemRefs);
}
return refs;
} else if (typeof value === "string") {
const refs = getReferencesFromString(value);

Expand Down

0 comments on commit 7ef2795

Please sign in to comment.