From 4fda0b18c67a0c1d0374ef974881d279bf7173cb Mon Sep 17 00:00:00 2001 From: canove Date: Sun, 20 Sep 2020 11:16:07 -0300 Subject: [PATCH] fix: qrcode modal throwing error when no whatsappId --- frontend/src/components/QrcodeModal/index.js | 1 + frontend/src/pages/Connections/index.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/QrcodeModal/index.js b/frontend/src/components/QrcodeModal/index.js index d6821ca..fe6e541 100644 --- a/frontend/src/components/QrcodeModal/index.js +++ b/frontend/src/components/QrcodeModal/index.js @@ -12,6 +12,7 @@ const QrcodeModal = ({ open, onClose, whatsAppId }) => { useEffect(() => { const fetchSession = async () => { + if (!whatsAppId) return; try { const { data } = await api.get(`/whatsapp/${whatsAppId}`); setQrCode(data.qrcode); diff --git a/frontend/src/pages/Connections/index.js b/frontend/src/pages/Connections/index.js index cb36419..3df1a65 100644 --- a/frontend/src/pages/Connections/index.js +++ b/frontend/src/pages/Connections/index.js @@ -199,13 +199,13 @@ const Connections = () => { > Are you sure? It cannot be reverted. - {/* */} + />