Skip to content

Commit

Permalink
🪟 🧹 Match sync catalog items by name and namespace, not their index (#…
Browse files Browse the repository at this point in the history
…20387)

* match by name and namespace, not index

* streamline per PR review
  • Loading branch information
teallarson authored Dec 13, 2022
1 parent 2ea6110 commit 7f6df3c
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ const CatalogTreeComponent: React.FC<React.PropsWithChildren<CatalogTreeProps>>

const changedStreams = useMemo(
() =>
streams.filter((stream, idx) => {
return stream.config?.selected !== initialValues.syncCatalog.streams[idx].config?.selected;
streams.filter((stream) => {
const matchingInitialValue = initialValues.syncCatalog.streams.find(
(initialStream) =>
initialStream.stream?.name === stream.stream?.name &&
initialStream.stream?.namespace === stream.stream?.namespace
);
return stream.config?.selected !== matchingInitialValue?.config?.selected;
}),
[initialValues.syncCatalog.streams, streams]
);
Expand Down

0 comments on commit 7f6df3c

Please sign in to comment.