mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-20 20:59:16 +00:00
fix: qrcode modal throwing error when no whatsappId
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user