Skip to content

Commit

Permalink
Update npm packages
Browse files Browse the repository at this point in the history
Also fix eslint warnings
  • Loading branch information
serprex committed Nov 7, 2023
1 parent 5b8d16b commit 2fd20b8
Show file tree
Hide file tree
Showing 4 changed files with 3,775 additions and 3,835 deletions.
5 changes: 2 additions & 3 deletions ui/app/mirrors/create/tablemapping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,10 @@ const TableMapping = ({
return table.toLowerCase().includes(searchQuery.toLowerCase());
})
);
}
if (searchQuery.length == 0) {
} else if (searchQuery.length == 0) {
getTablesOfSchema(schema);
}
}, [searchQuery, getTablesOfSchema]);
}, [searchQuery, getTablesOfSchema, schema]);

useEffect(() => {
fetchSchemas(sourcePeerName, setLoading).then((res) => setAllSchemas(res));
Expand Down
11 changes: 5 additions & 6 deletions ui/components/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ interface SearchProps {
setItems: Dispatch<SetStateAction<any>>;
filterFunction: (query: string) => {};
}
const SearchBar = (props: SearchProps) => {
const SearchBar = ({ setItems, filterFunction, allItems }: SearchProps) => {
const [searchQuery, setSearchQuery] = useState('');

useEffect(() => {
if (searchQuery.length > 0) {
props.setItems(props.filterFunction(searchQuery));
setItems(filterFunction(searchQuery));
} else if (searchQuery.length == 0) {
setItems(allItems);
}
if (searchQuery.length == 0) {
props.setItems(props.allItems);
}
}, [searchQuery]);
}, [searchQuery, setItems, filterFunction, allItems]);

return (
<SearchField
Expand Down
Loading

0 comments on commit 2fd20b8

Please sign in to comment.