Skip to content

Commit

Permalink
fix(search): showHidden now works
Browse files Browse the repository at this point in the history
  • Loading branch information
thesophiaxu committed Jan 17, 2022
1 parent ffd9df2 commit fba5963
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export function UnigraphSearch({ id }: any) {
window.unigraph
.getSearchResults(newQuery, 'metadata', 3, {
noPrimitives: true,
hideHidden: !showHidden,
})
.then((res) => {
// setResults(res.results.reverse());
Expand All @@ -81,12 +82,12 @@ export function UnigraphSearch({ id }: any) {
setEntities([]);
}
}, 500),
[],
[showHidden],
);

React.useEffect(() => {
search(query);
}, [query]);
}, [query, showHidden]);

return (
<>
Expand All @@ -98,7 +99,7 @@ export function UnigraphSearch({ id }: any) {
/>
<FormControlLabel
control={<Switch checked={showHidden} onChange={() => setShowHidden(!showHidden)} name="showHidden" />}
label="Show items without a view"
label="Show hidden items"
/>
<DynamicObjectListView
items={entities}
Expand Down

0 comments on commit fba5963

Please sign in to comment.