diff --git a/client/components/dialog.jsx b/client/components/dialog.jsx index c08cb539b..0cdda2dee 100644 --- a/client/components/dialog.jsx +++ b/client/components/dialog.jsx @@ -1,25 +1,25 @@ // Dialog box, for popups and modal blocking messages -import React from "react"; +import React from 'react'; const { useRef, useEffect } = React; function Dialog({ dismisskeys = [], closeText = 'Close', blocking = false, ...rest }) { const dialogRef = useRef(null); useEffect(()=>{ - if (dismisskeys.length !== 0) { + if(dismisskeys.length !== 0) { blocking ? dialogRef.current?.showModal() : dialogRef.current?.show(); } }, [dialogRef.current, dismisskeys]); - const dismiss = () => { - dismisskeys.forEach(key => { - if (key) { + const dismiss = ()=>{ + dismisskeys.forEach((key)=>{ + if(key) { localStorage.setItem(key, 'true'); } }); dialogRef.current?.close(); }; - + return ( {rest.children}