From 2d8874acaff95a9f16fc052d5f46841b0676e7e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Thu, 10 Oct 2024 13:17:24 +0200 Subject: [PATCH] move back to conditional showing instead of conditional rendering --- client/components/dialog.jsx | 13 +++++-------- .../notificationPopup/notificationPopup.jsx | 1 - 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/client/components/dialog.jsx b/client/components/dialog.jsx index 6fbdaca06..fcbab227f 100644 --- a/client/components/dialog.jsx +++ b/client/components/dialog.jsx @@ -6,13 +6,10 @@ function Dialog({ dismissKeys, closeText = 'Close', blocking = false, ...rest }) const dialogRef = useRef(null); useEffect(()=>{ - blocking ? dialogRef.current?.showModal() : dialogRef.current?.show(); - }, [dialogRef.current]); - - console.log(dismissKeys); - if (dismissKeys.length === 0) { - return null; - } + if (dismissKeys.length !== 0) { + blocking ? dialogRef.current?.showModal() : dialogRef.current?.show(); + } + }, [dialogRef.current, dismissKeys]); const dismiss = () => { dismissKeys.forEach(key => { @@ -22,7 +19,7 @@ function Dialog({ dismissKeys, closeText = 'Close', blocking = false, ...rest }) }); dialogRef.current?.close(); }; - console.log('rendering'); + return ( {rest.children} diff --git a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx index 2f363aa2f..81aa4be12 100644 --- a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx +++ b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx @@ -22,7 +22,6 @@ const NotificationPopup = ()=>{ try { const res = await request.get('/admin/notification/all'); - console.log('res', res.body); pickActiveNotifications(res.body || []); } catch (err) { console.log(err);