Skip to content

Commit 644f4fd

Browse files
authored
fix(list)filter connections for empty urls before showing the select (#506)
1 parent cb4aaab commit 644f4fd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/app/[locale]/list/_components/filter/SelectListSource.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ export function SelectListSource(props: {
4242
...aasRegistries.map((registry) => ({ ...registry, type: 'registry' as const })),
4343
];
4444

45-
setAasConnections(connections);
46-
if (connections.length > 0) {
45+
const filteredConnections = connections.filter((connection) => (connection.url ?? '').trim().length > 0);
46+
47+
setAasConnections(filteredConnections);
48+
if (filteredConnections.length > 0) {
4749
setSelectedConnectionIndex(0);
48-
props.onSelectedRepositoryChanged(connections[0]);
49-
props.onSelectedTypeChanged?.(connections[0].type);
50+
props.onSelectedRepositoryChanged(filteredConnections[0]);
51+
props.onSelectedTypeChanged?.(filteredConnections[0].type);
5052
}
5153
} catch (error) {
5254
notificationSpawner.spawn({

0 commit comments

Comments
 (0)