Fix obscure error in useToggles

This commit is contained in:
Misode
2021-10-14 00:45:06 +02:00
parent ed0b415af5
commit 146764df95
+2 -1
View File
@@ -325,7 +325,8 @@ function useToggles() {
} }
const isToggled = (key: string) => { const isToggled = (key: string) => {
return toggleState?.get(key) ?? toggleAll if (!(toggleState instanceof Map)) return false
return toggleState.get(key) ?? toggleAll
} }
return { expand, collapse, isToggled } return { expand, collapse, isToggled }