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(() => {
const fetchSession = async () => {
if (!whatsAppId) return;
try {
const { data } = await api.get(`/whatsapp/${whatsAppId}`);
setQrCode(data.qrcode);

View File

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