PublicRoomDialog and PairDeviceDialog method names renamed

This commit is contained in:
schlagmichdoch 2023-12-05 19:26:17 +01:00
parent 10b658e2e9
commit 5f77c785f9

View file

@ -1349,7 +1349,14 @@ class PairDeviceDialog extends Dialog {
_onPairDeviceInitiated(msg) { _onPairDeviceInitiated(msg) {
this.pairKey = msg.pairKey; this.pairKey = msg.pairKey;
this.roomSecret = msg.roomSecret; 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)}` this.$key.innerText = `${this.pairKey.substring(0,3)} ${this.pairKey.substring(3,6)}`
// Display the QR code for the url // Display the QR code for the url
const qr = new QRCode({ const qr = new QRCode({
content: this._getPairUrl(), content: this._getPairUrl(),
@ -1362,8 +1369,6 @@ class PairDeviceDialog extends Dialog {
join: true join: true
}); });
this.$qrCode.innerHTML = qr.svg(); this.$qrCode.innerHTML = qr.svg();
this.inputKeyContainer._enableChars();
this.show();
} }
_getPairUrl() { _getPairUrl() {
@ -1723,14 +1728,14 @@ class PublicRoomDialog extends Dialog {
_onPublicRoomCreated(roomId) { _onPublicRoomCreated(roomId) {
this.roomId = roomId; this.roomId = roomId;
this.setIdAndQrCode(); this._setKeyAndQrCode();
this.show(); this.show();
sessionStorage.setItem('public_room_id', roomId); sessionStorage.setItem('public_room_id', roomId);
} }
setIdAndQrCode() { _setKeyAndQrCode() {
if (!this.roomId) return; if (!this.roomId) return;
this.$key.innerText = this.roomId.toUpperCase(); this.$key.innerText = this.roomId.toUpperCase();
@ -1784,7 +1789,7 @@ class PublicRoomDialog extends Dialog {
if (!roomId) return; if (!roomId) return;
this.roomId = roomId; this.roomId = roomId;
this.setIdAndQrCode(); this._setKeyAndQrCode();
this._joinPublicRoom(roomId, true); this._joinPublicRoom(roomId, true);
} }
@ -1836,7 +1841,7 @@ class PublicRoomDialog extends Dialog {
if (isJoinedRoomId) { if (isJoinedRoomId) {
this.roomId = roomId; this.roomId = roomId;
this.roomIdJoin = false; this.roomIdJoin = false;
this.setIdAndQrCode(); this._setKeyAndQrCode();
} }
} }