north-star / commit
minor styling
src/app.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/app.js b/src/app.js index 790356f..abcb8fb 100644 --- a/src/app.js +++ b/src/app.js @@ -232,16 +232,18 @@ const renderInviteQrCard = async ({ title, url, statusText }) => { const card = document.createElement('div'); card.className = 'room-qr-card'; - card.setAttribute('aria-label', `${title} invite QR code`); + card.setAttribute('aria-label', title ? `${title} invite QR code` : 'Invite QR code'); - const label = document.createElement('p'); - label.className = 'room-qr-title'; - label.textContent = title; - card.appendChild(label); + if (title) { + const label = document.createElement('p'); + label.className = 'room-qr-title'; + label.textContent = title; + card.appendChild(label); + } const qrImage = document.createElement('img'); qrImage.className = 'room-qr'; - qrImage.alt = `${title}: scan to join room ${roomId}`; + qrImage.alt = title ? `${title}: scan to join room ${roomId}` : `Scan to join room ${roomId}`; card.appendChild(qrImage); const status = document.createElement('p'); @@ -271,15 +273,15 @@ const renderInviteQrCard = async ({ title, url, statusText }) => { if (inviteRoomQrList) { inviteRoomQrList.textContent = ''; + const isLocalRun = isLocalCommit || ['localhost', '127.0.0.1', '::1'].includes(location.hostname); const roomHash = buildRoomHash(roomId, roomKeyBase64); await renderInviteQrCard({ - title: 'This Device URL', + title: isLocalRun ? 'This Device URL' : '', url: inviteRoomUrl, statusText: 'Scan to join this room' }); - const isLocalRun = isLocalCommit || ['localhost', '127.0.0.1', '::1'].includes(location.hostname); if (isLocalRun) { await renderInviteQrCard({ title: 'GitLab Pages URL',