mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-25 00:16:29 +02:00
toggle
This commit is contained in:
parent
42e6422cdd
commit
5bab6ad964
1 changed files with 1 additions and 12 deletions
|
|
@ -51,18 +51,7 @@ export function SearchDialog({ open, onOpenChange, onSelectFile, onSelectRun }:
|
|||
}, [open, activeSection])
|
||||
|
||||
const toggleType = useCallback((type: SearchType) => {
|
||||
setActiveTypes(prev => {
|
||||
const next = new Set(prev)
|
||||
if (next.has(type)) {
|
||||
// Don't allow deselecting all
|
||||
if (next.size > 1) {
|
||||
next.delete(type)
|
||||
}
|
||||
} else {
|
||||
next.add(type)
|
||||
}
|
||||
return next
|
||||
})
|
||||
setActiveTypes(new Set([type]))
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue