mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-08 20:23:39 +00:00
Show dialog when dismissKey prop is not specified
This commit is contained in:
@@ -7,7 +7,7 @@ function Dialog({ dismissKey, closeText = 'Close', blocking = false, ...rest })
|
|||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(dismissKey && !localStorage.getItem(dismissKey)) {
|
if(!dismissKey || !localStorage.getItem(dismissKey)) {
|
||||||
blocking ? dialogRef.current?.showModal() : dialogRef.current?.show();
|
blocking ? dialogRef.current?.showModal() : dialogRef.current?.show();
|
||||||
setOpen(true);
|
setOpen(true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user