fix: qrcode modal throwing error when no whatsappId

This commit is contained in:
canove
2020-09-20 11:16:07 -03:00
parent c56f848fa6
commit 4fda0b18c6
2 changed files with 3 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ const QrcodeModal = ({ open, onClose, whatsAppId }) => {
useEffect(() => { useEffect(() => {
const fetchSession = async () => { const fetchSession = async () => {
if (!whatsAppId) return;
try { try {
const { data } = await api.get(`/whatsapp/${whatsAppId}`); const { data } = await api.get(`/whatsapp/${whatsAppId}`);
setQrCode(data.qrcode); setQrCode(data.qrcode);

View File

@@ -199,13 +199,13 @@ const Connections = () => {
> >
Are you sure? It cannot be reverted. Are you sure? It cannot be reverted.
</ConfirmationModal> </ConfirmationModal>
{/* <QrcodeModal <QrcodeModal
open={qrModalOpen} open={qrModalOpen}
onClose={handleCloseQrModal} onClose={handleCloseQrModal}
whatsAppId={ whatsAppId={
selectedWhatsApp && !whatsAppModalOpen && selectedWhatsApp.id selectedWhatsApp && !whatsAppModalOpen && selectedWhatsApp.id
} }
/> */} />
<WhatsAppModal <WhatsAppModal
open={whatsAppModalOpen} open={whatsAppModalOpen}
onClose={handleCloseWhatsAppModal} onClose={handleCloseWhatsAppModal}