Improve close logic

This commit is contained in:
Eric Bailey
2024-03-21 11:22:11 -05:00
parent ec236a91e5
commit 0344104d7b
+4 -1
View File
@@ -54,7 +54,10 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
>('auto')
const closeAllDialogs = React.useCallback(() => {
activeDialogs.current.forEach(dialog => dialog.current.close())
openDialogs.current.forEach(id => {
const dialog = activeDialogs.current.get(id)
if (dialog) dialog.current.close()
})
return openDialogs.current.size > 0
}, [])