From 73f7a0d4d83daa879e7c50269c11680d7d60accc Mon Sep 17 00:00:00 2001 From: N-Pex Date: Fri, 2 Apr 2021 09:40:23 +0200 Subject: [PATCH] Fix QR code --- src/components/RoomInfo.vue | 50 ++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/src/components/RoomInfo.vue b/src/components/RoomInfo.vue index ff3829a..c9854be 100644 --- a/src/components/RoomInfo.vue +++ b/src/components/RoomInfo.vue @@ -26,7 +26,14 @@
{{ roomName }}
{{ roomTopic }}
Created by {{ creator }}
- + + + @@ -113,7 +120,11 @@ Your are logged in as {{ displayName }}. - View @@ -263,21 +274,23 @@ export default { }, updateQRCode() { - var fullUrl = this.roomLink; - var canvas = document.getElementById("room-qr"); - QRCode.toCanvas( - canvas, - fullUrl, - { - type: "image/png", - margin: 1, - width: canvas.clientWidth, - }, - function (error) { - if (error) console.error(error); - else console.log("success!"); - } - ); + var fullUrl = this.publicRoomLink; + var canvas = this.$refs.roomQr; + if (fullUrl && canvas) { + QRCode.toCanvas( + canvas, + fullUrl, + { + type: "image/png", + margin: 1, + width: canvas.clientWidth, + }, + function (error) { + if (error) console.error(error); + else console.log("success!"); + } + ); + } }, memberAvatar(member) { @@ -298,7 +311,7 @@ export default { }, copyRoomLink() { - this.$copyText(this.roomLink).then( + this.$copyText(this.publicRoomLink).then( function (e) { console.log(e); }, @@ -359,6 +372,7 @@ export default { }) .finally(() => { this.updatingJoinRule = false; + this.updateQRCode(); }); }, },