Skip to content

Commit a3b8823

Browse files
Removing unnecessary useEffect
1 parent a8d4889 commit a3b8823

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

src/components/ComponentsSelection/ComponentsSelectionContainer.tsx

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -109,26 +109,6 @@ export const ComponentsSelectionContainer: React.FC<ComponentsSelectionProps> =
109109
setTemplateDefaultsError(errors.length ? errors.join('\n') : null);
110110
}, [availableManagedComponentsListData, defaultComponents, setComponentsList]);
111111

112-
useEffect(() => {
113-
if (!initialized.current) return;
114-
if (!defaultComponents?.length) return;
115-
if (!componentsList?.length) return;
116-
117-
const anySelected = componentsList.some((c) => c.isSelected);
118-
if (anySelected) return;
119-
120-
const updated = componentsList.map((c) => {
121-
const template = defaultComponents.find((dc) => dc.name === c.name);
122-
if (!template) return c;
123-
const templateVersion = template.version;
124-
const selectedVersion =
125-
templateVersion && Array.isArray(c.versions) && c.versions.includes(templateVersion) ? templateVersion : '';
126-
return { ...c, isSelected: true, selectedVersion };
127-
});
128-
129-
setComponentsList(updated);
130-
}, [defaultComponents, componentsList, setComponentsList]);
131-
132112
if (isLoading) {
133113
return <Loading />;
134114
}

0 commit comments

Comments
 (0)