From 5f77c785f94edbc7d0c47a63c8c4cc2047c05fee Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Tue, 5 Dec 2023 19:26:17 +0100 Subject: [PATCH] PublicRoomDialog and PairDeviceDialog method names renamed --- public/scripts/ui.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/public/scripts/ui.js b/public/scripts/ui.js index 7a105c8..f6be387 100644 --- a/public/scripts/ui.js +++ b/public/scripts/ui.js @@ -1349,7 +1349,14 @@ class PairDeviceDialog extends Dialog { _onPairDeviceInitiated(msg) { this.pairKey = msg.pairKey; this.roomSecret = msg.roomSecret; + this._setKeyAndQRCode(); + this.inputKeyContainer._enableChars(); + this.show(); + } + + _setKeyAndQRCode() { this.$key.innerText = `${this.pairKey.substring(0,3)} ${this.pairKey.substring(3,6)}` + // Display the QR code for the url const qr = new QRCode({ content: this._getPairUrl(), @@ -1362,8 +1369,6 @@ class PairDeviceDialog extends Dialog { join: true }); this.$qrCode.innerHTML = qr.svg(); - this.inputKeyContainer._enableChars(); - this.show(); } _getPairUrl() { @@ -1723,14 +1728,14 @@ class PublicRoomDialog extends Dialog { _onPublicRoomCreated(roomId) { this.roomId = roomId; - this.setIdAndQrCode(); + this._setKeyAndQrCode(); this.show(); sessionStorage.setItem('public_room_id', roomId); } - setIdAndQrCode() { + _setKeyAndQrCode() { if (!this.roomId) return; this.$key.innerText = this.roomId.toUpperCase(); @@ -1784,7 +1789,7 @@ class PublicRoomDialog extends Dialog { if (!roomId) return; this.roomId = roomId; - this.setIdAndQrCode(); + this._setKeyAndQrCode(); this._joinPublicRoom(roomId, true); } @@ -1836,7 +1841,7 @@ class PublicRoomDialog extends Dialog { if (isJoinedRoomId) { this.roomId = roomId; this.roomIdJoin = false; - this.setIdAndQrCode(); + this._setKeyAndQrCode(); } }