Skip to content

Commit

Permalink
fix label addition logic
Browse files Browse the repository at this point in the history
  • Loading branch information
macjuul committed Jan 30, 2025
1 parent 4c4a4b7 commit c18b300
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/modals/graph-labels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,17 @@ function GraphLabelEditor() {
const mapping = useConnection((c) => c?.graphLabels ?? {});

const unmappedTables = useMemo(() => {
return tables.filter(
(table) =>
!(table.schema.name in mapping) &&
table.schema.kind.kind !== "NORMAL" &&
fuzzyMatch(search, table.schema.name),
);
return tables.filter((table) => {
if (table.schema.name in mapping) {
return false;
}

if (table.schema.kind.kind === "RELATION") {
return false;
}

return fuzzyMatch(search, table.schema.name);
});
}, [tables, mapping, search]);

const mappedTables = useMemo(() => {
Expand Down

0 comments on commit c18b300

Please sign in to comment.