0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-05 10:12:41 +00:00

Fix for modals

This commit is contained in:
G.Ambatte
2024-06-04 16:51:43 +12:00
parent 8685c5cae4
commit f3b01bc75c

View File

@@ -15,12 +15,12 @@ function Modal({ dismissKey, blocking, children, ...rest }) {
}, []); }, []);
useEffect(()=>{ useEffect(()=>{
if(blocking) { if(open) {
modal ? ref.current?.showModal() : ref.current?.show(); blocking ? ref.current?.showModal() : ref.current?.show();
} else { } else {
ref.current?.close(); ref.current?.close();
} }
}, [blocking]); }, [open]);
const dismiss = function(){ const dismiss = function(){
localStorage.setItem(dismissKey, true); localStorage.setItem(dismissKey, true);