From a60ad9b2795bed11fcd1f467c65c1cc95be6f4d1 Mon Sep 17 00:00:00 2001 From: Gabriel Pastori <58153955+gabrielpastori1@users.noreply.github.com> Date: Sun, 5 Nov 2023 01:30:06 -0300 Subject: [PATCH] fix: qr code error management --- src/components/modal/ConnectPhone.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/modal/ConnectPhone.vue b/src/components/modal/ConnectPhone.vue index da4dc87..0f80ceb 100644 --- a/src/components/modal/ConnectPhone.vue +++ b/src/components/modal/ConnectPhone.vue @@ -66,11 +66,12 @@ export default { this.instance.instance.instanceName ); - if (response.base64) this.qrCode = response.base64; - else { + if (response.qrCode) this.qrCode = response.qrCode; + else if (response.instance) { this.dialog = false; return; - } + } else throw new Error("Não foi possível carregar o QR Code, tente reiniciar o API"); + this.timeout = setTimeout(this.loadQr, 40000); } catch (e) { this.error = e.message?.message || e.message || e;