Skip to content

Commit

Permalink
fix detail dialog behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkeye217 committed Oct 16, 2024
1 parent a221e69 commit 8d83d28
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions web/src/components/overlay/detail/SearchDetailDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ export default function SearchDetailDialog({
const [isOpen, setIsOpen] = useState(search != undefined);

useEffect(() => {
setIsOpen(search != undefined);
if (search) {
setIsOpen(search != undefined);
}
}, [search]);

const searchTabs = useMemo(() => {
Expand All @@ -122,12 +124,6 @@ export default function SearchDetailDialog({
views.splice(index, 1);
}

// TODO implement
//if (!config.semantic_search.enabled) {
// const index = views.indexOf("similar-calendar");
// views.splice(index, 1);
// }

return views;
}, [config, search]);

Expand All @@ -154,14 +150,7 @@ export default function SearchDetailDialog({
const Description = isDesktop ? DialogDescription : MobilePageDescription;

return (
<Overlay
open={isOpen}
onOpenChange={(open) => {
if (!open) {
setSearch(undefined);
}
}}
>
<Overlay open={isOpen} onOpenChange={() => setIsOpen(!isOpen)}>
<Content
className={cn(
"scrollbar-container overflow-y-auto",
Expand Down

0 comments on commit 8d83d28

Please sign in to comment.